Skip to content

Commit 9c17eba

Browse files
committed
upgrade mongodb dependency, display RTT in microseconds instead of ms
1 parent ba0789a commit 9c17eba

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ let package:Package = .init(
9999
.package(url: "https://github.com/tayloraswift/swift-hash", .upToNextMinor(
100100
from: "0.5.0")),
101101
.package(url: "https://github.com/tayloraswift/swift-mongodb", .upToNextMinor(
102-
from: "0.10.6")),
102+
from: "0.10.7")),
103103
.package(url: "https://github.com/tayloraswift/swift-png", .upToNextMinor(
104104
from: "4.2.0")),
105105

Sources/SwiftinitServer/Administration/Swiftinit.AdminPage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ extension Swiftinit.AdminPage:Swiftinit.AdministrativePage
215215
for (host, latency):(Mongo.Host, Nanoseconds) in self.servers
216216
{
217217
$0[.dt] = "\(host)"
218-
$0[.dd] = "\(latency.rawValue / 1_000_000) ms"
218+
$0[.dd] = "\(latency.rawValue / 1_000) µs"
219219
}
220220
}
221221

Sources/SwiftinitServer/Main.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct Main
1919
/// Whether to enable GitHub integration if access keys are available.
2020
/// Defaults to false.
2121
var github:Bool
22-
var mongo:String
22+
var mongo:Mongo.Host
2323

2424
private
2525
init() throws
@@ -90,7 +90,7 @@ extension Main
9090
case "-m", "--mongo":
9191
switch arguments.next()
9292
{
93-
case let host?: self.mongo = host
93+
case let host?: self.mongo = .init(host)
9494
case nil: throw Main.OptionsError.invalidMongoReplicaSetSeed
9595
}
9696

@@ -189,7 +189,9 @@ extension Main
189189
$0.appname = "Unidoc Server"
190190

191191
$0.connectionTimeout = .seconds(5)
192-
$0.monitorInterval = .seconds(5)
192+
$0.monitorInterval = .seconds(3)
193+
194+
$0.topology = .replicated(set: "swiftinit-rs")
193195
}
194196

195197
var configuration:TLSConfiguration = .makeClientConfiguration()
@@ -199,9 +201,7 @@ extension Main
199201
niossl: try .init(configuration: configuration))
200202
let options:Swiftinit.ServerOptions = try self.options()
201203

202-
// Uncomment this to debug MongoDB driver issues:
203-
// let _logger:Mongo.Logger = .init(level: .full)
204-
await mongodb.withSessionPool(logger: nil)
204+
await mongodb.withSessionPool(logger: .init(level: .error))
205205
{
206206
@Sendable (pool:Mongo.SessionPool) in
207207

0 commit comments

Comments
 (0)