File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -458,6 +458,11 @@ extension Unidoc.DB
458
458
clear: Bool = true ,
459
459
with session: Mongo . Session ) async throws -> Unidoc . SitemapDelta ?
460
460
{
461
+ // We assume compressing the search JSON will take a (relatively) long time, so we do
462
+ // it before performing any database operations.
463
+ let search : Unidoc . TextResource < Symbol . Edition > = . init( id: volume. id,
464
+ text: . init( compressing: volume. index. utf8) )
465
+
461
466
if clear
462
467
{
463
468
try await self . vertices. clear ( range: volume. edition, with: session)
@@ -476,7 +481,7 @@ extension Unidoc.DB
476
481
}
477
482
478
483
try await self. volumes. insert ( some: volume. metadata, with: session)
479
- try await self. search. insert ( some: volume . search, with: session)
484
+ try await self. search. insert ( some: search, with: session)
480
485
try await self. trees. insert ( some: volume. trees, with: session)
481
486
482
487
try await self. vertices. insert ( volume. vertices, with: session)
You can’t perform that action at this time.
0 commit comments