Skip to content

Commit eddc7b0

Browse files
committed
add a way to enqueue all symbol graphs for uplinking
1 parent 81932c9 commit eddc7b0

File tree

5 files changed

+33
-21
lines changed

5 files changed

+33
-21
lines changed

Sources/SwiftinitPages/Surfaces/Administration/Swiftinit.AdminPage.swift

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -163,28 +163,36 @@ extension Swiftinit.AdminPage:Swiftinit.AdministrativePage
163163
}
164164

165165
// Non-destructive actions.
166-
for (action, label):(Swiftinit.API.Post, String) in
167-
[
168-
(
169-
.uplinkAll,
170-
"Uplink all volumes"
171-
),
172-
]
173-
{
174-
main[.hr]
166+
main[.hr]
175167

176-
main[.form]
168+
main[.form]
169+
{
170+
$0.enctype = "\(MediaType.application(.x_www_form_urlencoded))"
171+
$0.action = "\(Swiftinit.API[.uplinkAll])"
172+
$0.method = "post"
173+
}
174+
content:
175+
{
176+
$0[.label]
177177
{
178-
$0.enctype = "\(MediaType.application(.x_www_form_urlencoded))"
179-
$0.action = "\(Swiftinit.API[action])"
180-
$0.method = "post"
178+
$0.class = "checkbox"
179+
$0.title = "Queue all symbol graphs for uplinking."
181180
}
182181
content:
183182
{
184-
$0[.p]
183+
$0[.input]
185184
{
186-
$0[.button] { $0.type = "submit" } = label
185+
$0.type = "checkbox"
186+
$0.name = "queue"
187+
$0.value = "true"
187188
}
189+
190+
$0[.span] = "Queue all symbol graphs"
191+
}
192+
193+
$0[.p]
194+
{
195+
$0[.button] { $0.type = "submit" } = "Uplink volumes"
188196
}
189197
}
190198

Sources/SwiftinitRender/Formats/Swiftinit.RenderFormat.Assets.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extension Swiftinit.RenderFormat.Assets
2222
/// To reduce cache churn, not all assets are versioned. For example, the fonts and
2323
/// the favicon do not use the version numbers.
2424
@inlinable public static
25-
var version:MinorVersion { .v(7, 0) }
25+
var version:MinorVersion { .v(8, 0) }
2626
}
2727
extension Swiftinit.RenderFormat.Assets
2828
{

Sources/SwiftinitServer/Endpoints/Procedural/Swiftinit.GlobalUplinkEndpoint.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ extension Swiftinit
44
{
55
struct GlobalUplinkEndpoint:Sendable
66
{
7-
init()
7+
let queue:Bool
8+
9+
init(queue:Bool)
810
{
11+
self.queue = queue
912
}
1013
}
1114
}
@@ -22,6 +25,6 @@ extension Swiftinit.GlobalUplinkEndpoint:NonblockingEndpoint
2225
session:Mongo.Session,
2326
status:Status) async
2427
{
25-
try? await server.db.unidoc.rebuild(with: session)
28+
try? await server.db.unidoc.rebuild(queue: self.queue, with: session)
2629
}
27-
}
30+
}

Sources/SwiftinitServer/Swiftinit.AnyEndpoint.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ extension Swiftinit.AnyEndpoint
327327
}
328328

329329
case .uplinkAll:
330-
return .procedural(Swiftinit.GlobalUplinkEndpoint.init())
330+
return .procedural(Swiftinit.GlobalUplinkEndpoint.init(
331+
queue: form["queue"] == "true"))
331332

332333
case .uplink:
333334
if let package:String = form["package"],

Sources/UnidocDB/UnidocDatabase.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ extension UnidocDatabase
581581
extension UnidocDatabase
582582
{
583583
public
584-
func rebuild(with session:Mongo.Session, queue:Bool = false) async throws
584+
func rebuild(queue:Bool = false, with session:Mongo.Session) async throws
585585
{
586586
if queue
587587
{

0 commit comments

Comments
 (0)