瀏覽代碼

fix(cli): flush cache before adding scheduled jobs

Nicolas Meienberger 1 年之前
父節點
當前提交
2cff0de4ac

+ 7 - 7
packages/cli/src/executors/system/system.executors.ts

@@ -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(

+ 0 - 2
src/server/services/system/system.service.ts

@@ -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 } };
     }