Sfoglia il codice sorgente

refactor NchanDelegator

Yuki Takei 5 anni fa
parent
commit
c0df3cad1d
1 ha cambiato i file con 1 aggiunte e 5 eliminazioni
  1. 1 5
      src/server/service/config-pubsub/nchan.js

+ 1 - 5
src/server/service/config-pubsub/nchan.js

@@ -32,10 +32,6 @@ class NchanDelegator extends ConfigPubsubDelegator {
    * @inheritdoc
    */
   shouldResubscribe() {
-    if (this.client == null) {
-      return false;
-    }
-
     if (this.connection != null && this.connection.connected) {
       return false;
     }
@@ -53,7 +49,7 @@ class NchanDelegator extends ConfigPubsubDelegator {
       }
     }
 
-    if (this.shouldResubscribe()) {
+    if (this.client != null && this.shouldResubscribe()) {
       logger.info('The connection to config pubsub server is offline. Try to reconnect...');
     }