bjustin-ibm commented on a change in pull request #197: Use one canary document 
per provider instance
URL: 
https://github.com/apache/incubator-openwhisk-package-kafka/pull/197#discussion_r126509631
 
 

 ##########
 File path: provider/database.py
 ##########
 @@ -83,33 +83,37 @@ def createCanary(self):
         maxRetries = 3
         retryCount = 0
 
+        instance = os.getenv('INSTANCE', 'messageHubTrigger-0')
+        canaryId = "canary-{}".format(instance)
+
         while retryCount < maxRetries:
             try:
-                document = dict()
-                document['canary'] = datetime.now().isoformat()
+                if canaryId in self.database.keys(remote=True):
+                    # update the timestamp to cause a document change
+                    logging.debug("[database] Canary doc exists, updating it.")
+
 
 Review comment:
   I'll put one after L101
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to