Browse Source

Delete useless code

tumao 3 years ago
parent
commit
7d2fdbfee2
2 changed files with 1 additions and 6 deletions
  1. 1 5
      express/src/crons/crons.service.ts
  2. 0 1
      express/src/events/index.ts

+ 1 - 5
express/src/crons/crons.service.ts

@@ -19,7 +19,7 @@ export class CronsService {
           return this.getCollections(WS_EVENTS.COLLECTION);
         }
         if (!cronJobEntity) {
-          throw new Error('No existed job entity');
+          return;
         }
         return Number(type) === WS_EVENTS_TYPE.STOP
           ? cronJobEntity.stop()
@@ -42,10 +42,6 @@ export class CronsService {
         return res;
       } catch (error) {
         // When user not connect milvus, stop cron
-        // this.toggleCronJobByName({
-        //   name: WS_EVENTS.COLLECTION,
-        //   type: WS_EVENTS_TYPE.STOP,
-        // });
         const cronJobEntity = this.schedulerRegistry.getCronJob(name);
         if (cronJobEntity) {
           cronJobEntity.stop();

+ 0 - 1
express/src/events/index.ts

@@ -20,7 +20,6 @@ export class PubSub {
     // const handlerArgs = Array.prototype.slice.call(arguments, 1);
     if (!(eventType in this.handlers)) {
       console.warn(`eventType: ${eventType} missing`);
-      // throw new Error(`eventType: ${eventType} missing`);
       return;
     }
     this.handlers[eventType].forEach((handler) => {