Skip to content

Commit 9640d07

Browse files
kriszypEthan-Arrowood
authored andcommitted
Add a final cleanup log message to know when orphan cleanup is finished
1 parent 8e6dd0b commit 9640d07

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

dataLayer/schema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,6 @@ function cleanupOrphanBlobs(request) {
359359
const database = databases[request.database];
360360
if (!database) throw new ClientError(`Unknown database '${request.database}'`);
361361
// don't await, it will probably take hours
362-
cleanupOrphans(databases[request.database]);
362+
cleanupOrphans(databases[request.database], request.database);
363363
return { message: 'Orphaned blobs cleanup started, check logs for progress' };
364364
}

resources/blob.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ function polyfillBlob() {
11321132
* from the database, and if not, deletes them
11331133
* @param database
11341134
*/
1135-
export async function cleanupOrphans(database: any) {
1135+
export async function cleanupOrphans(database: any, databaseName?: string) {
11361136
let store: LMDBStore;
11371137
let auditStore: LMDBStore;
11381138
let orphansDeleted = 0;
@@ -1152,6 +1152,7 @@ export async function cleanupOrphans(database: any) {
11521152
}
11531153
// remove all remaining paths are not referenced
11541154
await removePathsThatAreNotReferenced();
1155+
logger.warn?.(`Cleaned Orphan Blobs from ${databaseName ?? 'database'}, deleted ${orphansDeleted} blobs)`);
11551156
return orphansDeleted;
11561157
async function searchPath(path: string) {
11571158
try {

0 commit comments

Comments
 (0)