dubeejw commented on a change in pull request #186: automatically monitor and
restore the health of the DB changes feed
URL:
https://github.com/apache/incubator-openwhisk-package-kafka/pull/186#discussion_r124060508
##########
File path: provider/database.py
##########
@@ -67,9 +68,42 @@ def disableTrigger(self, triggerFQN, status_code):
logging.error('[{}] Uncaught exception while disabling trigger:
{}'.format(triggerFQN, e))
- def changesFeed(self):
- return self.database.infinite_changes(include_docs=True)
+ def changesFeed(self, timeout, since = None):
+ if since == None:
+ return self.database.infinite_changes(include_docs=True,
heartbeat=(timeout*1000))
+ else:
+ return self.database.infinite_changes(include_docs=True,
heartbeat=(timeout*1000), since=since)
+
+ def createCanary(self):
+ retryCount = 3
+
+ while retryCount >= 0:
+ if retryCount == 0:
+ logging.error('[canary] Retried and failed {} times to create
a canary'.format(retryCount))
Review comment:
If canary document is not created by this function will the attempt to
create it again occur when the canary is updated?
----------------------------------------------------------------
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