Skip to content

Commit a6bc600

Browse files
committed
feat(cli-repl): do not wait for log clean-up MONGOSH-1990
1 parent adf5199 commit a6bc600

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,11 @@ export class CliRepl implements MongoshIOProvider {
266266
this.warnAboutInaccessibleFile(err, path),
267267
});
268268

269-
await this.logManager.cleanupOldLogFiles();
269+
// 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+
270274
markTime(TimingCategories.Logging, 'cleaned up log files');
271275

272276
if (!this.logWriter) {

0 commit comments

Comments
 (0)