Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Sources/PostgresSessions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//
//

import PerfectLib
import PerfectPostgreSQL
import PerfectSession
import PerfectHTTP
Expand Down Expand Up @@ -59,7 +60,7 @@ public struct PostgresSessions {
var session = PerfectSession()
session.token = UUID().uuidString
session.idle = SessionConfig.idle

// adding for x-forwarded-for support:
let ff = request.header(.xForwardedFor) ?? ""
if ff.isEmpty {
Expand Down Expand Up @@ -146,7 +147,10 @@ public struct PostgresSessions {
let server = PGConnection()
let status = server.connectdb(PostgresSessionConnector.connectionString())
if status != .ok {
print("\(status)")
Log.error(message:
"Unable to connect to the session database. " +
"connectionString: \(PostgresSessionConnector.connectionString()), " +
"status: \(status)")
}
return server
}
Expand Down