You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-23 22:36:32 +02:00
Chore: Fix tests
This commit is contained in:
@@ -452,6 +452,8 @@ class Application extends BaseApplication {
|
|||||||
type: 'FOLDER_SELECT',
|
type: 'FOLDER_SELECT',
|
||||||
id: Setting.value('activeFolderId'),
|
id: Setting.value('activeFolderId'),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.startRotatingLogMaintenance(Setting.value('profileDir'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -566,6 +566,8 @@ class Application extends BaseApplication {
|
|||||||
|
|
||||||
await SpellCheckerService.instance().initialize(new SpellCheckerServiceDriverNative());
|
await SpellCheckerService.instance().initialize(new SpellCheckerServiceDriverNative());
|
||||||
|
|
||||||
|
this.startRotatingLogMaintenance(Setting.value('profileDir'));
|
||||||
|
|
||||||
// await populateDatabase(reg.db(), {
|
// await populateDatabase(reg.db(), {
|
||||||
// clearDatabase: true,
|
// clearDatabase: true,
|
||||||
// folderCount: 1000,
|
// folderCount: 1000,
|
||||||
|
|||||||
@@ -735,6 +735,20 @@ export default class BaseApplication {
|
|||||||
return toSystemSlashes(output, 'linux');
|
return toSystemSlashes(output, 'linux');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected startRotatingLogMaintenance(profileDir: string) {
|
||||||
|
this.rotatingLogs = new RotatingLogs(profileDir);
|
||||||
|
const processLogs = async () => {
|
||||||
|
try {
|
||||||
|
await this.rotatingLogs.cleanActiveLogFile();
|
||||||
|
await this.rotatingLogs.deleteNonActiveLogFiles();
|
||||||
|
} catch (error) {
|
||||||
|
appLogger.error(error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
shim.setTimeout(() => { void processLogs(); }, 60000);
|
||||||
|
shim.setInterval(() => { void processLogs(); }, 24 * 60 * 60 * 1000);
|
||||||
|
}
|
||||||
|
|
||||||
public async start(argv: string[], options: StartOptions = null): Promise<any> {
|
public async start(argv: string[], options: StartOptions = null): Promise<any> {
|
||||||
options = {
|
options = {
|
||||||
keychainEnabled: true,
|
keychainEnabled: true,
|
||||||
@@ -932,18 +946,6 @@ export default class BaseApplication {
|
|||||||
|
|
||||||
await MigrationService.instance().run();
|
await MigrationService.instance().run();
|
||||||
|
|
||||||
this.rotatingLogs = new RotatingLogs(profileDir);
|
|
||||||
const processLogs = async () => {
|
|
||||||
try {
|
|
||||||
await this.rotatingLogs.cleanActiveLogFile();
|
|
||||||
await this.rotatingLogs.deleteNonActiveLogFiles();
|
|
||||||
} catch (error) {
|
|
||||||
appLogger.error(error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
shim.setTimeout(() => { void processLogs(); }, 60000);
|
|
||||||
shim.setInterval(() => { void processLogs(); }, 24 * 60 * 60 * 1000);
|
|
||||||
|
|
||||||
return argv;
|
return argv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user