Skip to content

Commit 6dacb62

Browse files
committed
fix: mark time after log cleanup
1 parent f92b02b commit 6dacb62

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

packages/cli-repl/src/cli-repl.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,14 @@ export class CliRepl implements MongoshIOProvider {
267267
});
268268

269269
// Do not wait for log cleanup and log errors if MongoLogManager throws any.
270-
void this.logManager.cleanupOldLogFiles().catch((err) => {
271-
this.bus.emit('mongosh:error', err, 'log');
272-
});
273-
274-
markTime(TimingCategories.Logging, 'cleaned up log files');
270+
void this.logManager
271+
.cleanupOldLogFiles()
272+
.catch((err) => {
273+
this.bus.emit('mongosh:error', err, 'log');
274+
})
275+
.finally(() => {
276+
markTime(TimingCategories.Logging, 'cleaned up log files');
277+
});
275278

276279
if (!this.logWriter) {
277280
this.logWriter ??= await this.logManager.createLogWriter();

0 commit comments

Comments
 (0)