Explain the SSL failure instead of just reporting it
A Postgres URL without an sslmode made lib/pq ask for TLS and die with "SSL is not enabled on the server", which reads like a server fault when it is really a connection-string default. The error now says what to append, and the server retries briefly so a deploy is not marked unhealthy just because Postgres was still starting. The sync server URL also defaults to the hosted instance now, so a fresh install needs no setup.
This commit is contained in:
@@ -39,6 +39,9 @@ final class SyncService: ObservableObject {
|
||||
private static let urlKey = "sync.serverURL"
|
||||
private static let versionKey = "sync.version"
|
||||
|
||||
/// Where sync points unless the user overrides it in the sync panel.
|
||||
static let defaultServerURL = "https://prompt.tzgyn.dev"
|
||||
|
||||
private var lastVersion: Int64 {
|
||||
get { Int64(defaults.integer(forKey: Self.versionKey)) }
|
||||
set { defaults.set(newValue, forKey: Self.versionKey) }
|
||||
@@ -54,7 +57,7 @@ final class SyncService: ObservableObject {
|
||||
|
||||
private init() {
|
||||
code = defaults.string(forKey: Self.codeKey)
|
||||
serverURL = defaults.string(forKey: Self.urlKey) ?? "http://localhost:8080"
|
||||
serverURL = defaults.string(forKey: Self.urlKey) ?? Self.defaultServerURL
|
||||
}
|
||||
|
||||
func start() {
|
||||
|
||||
Reference in New Issue
Block a user