fix(cli): flush cache before adding scheduled jobs

This commit is contained in:
Nicolas Meienberger 2023-10-15 13:54:41 +02:00
parent 58a83391e2
commit 2cff0de4ac
2 changed files with 7 additions and 9 deletions

View file

@ -258,6 +258,13 @@ export class SystemExecutors {
spinner.done('Watcher started');
// Flush redis cache
this.logger.info('Flushing redis cache...');
const cache = new Redis({ host: '127.0.0.1', port: 6379, password: envMap.get('REDIS_PASSWORD'), lazyConnect: true });
await cache.connect();
await cache.flushdb();
await cache.quit();
this.logger.info('Starting queue...');
const queue = new Queue('events', { connection: { host: '127.0.0.1', port: 6379, password: envMap.get('REDIS_PASSWORD') } });
this.logger.info('Obliterating queue...');
@ -295,13 +302,6 @@ export class SystemExecutors {
this.logger.info('Starting all apps...');
await appExecutor.startAllApps();
// Flush redis cache
this.logger.info('Flushing redis cache...');
const cache = new Redis({ host: '127.0.0.1', port: 6379, password: envMap.get('REDIS_PASSWORD'), lazyConnect: true });
await cache.connect();
await cache.flushdb();
await cache.quit();
console.log(
boxen(
`Visit: http://${envMap.get('INTERNAL_IP')}:${envMap.get(

View file

@ -69,8 +69,6 @@ export class SystemServiceClass {
const info = systemInfoSchema.safeParse(readJsonFile('/runtipi/state/system-info.json'));
if (!info.success) {
Logger.error('Error parsing system info', info.error);
return { cpu: { load: 0 }, disk: { total: 0, used: 0, available: 0 }, memory: { total: 0, available: 0, used: 0 } };
}