Przeglądaj źródła

added queueKey to error info when trying to push to redis

Henry Oswald 5 lat temu
rodzic
commit
49bed6595d
1 zmienionych plików z 8 dodań i 11 usunięć
  1. 8 11
      services/real-time/app/js/DocumentUpdaterManager.js

+ 8 - 11
services/real-time/app/js/DocumentUpdaterManager.js

@@ -132,18 +132,15 @@ const DocumentUpdaterManager = {
         error = new OError('error pushing update into redis').withCause(error)
         return callback(error)
       }
-      rclient.rpush(
-        DocumentUpdaterManager._getPendingUpdateListKey(),
-        doc_key,
-        function (error) {
-          if (error) {
-            error = new OError('error pushing doc_id into redis').withCause(
-              error
-            )
-          }
-          callback(error)
+      const queueKey = DocumentUpdaterManager._getPendingUpdateListKey()
+      rclient.rpush(queueKey, doc_key, function (error) {
+        if (error) {
+          error = new OError('error pushing doc_id into redis')
+            .withInfo({ queueKey })
+            .withCause(error)
         }
-      )
+        callback(error)
+      })
     })
   }
 }