This repository has been archived by the owner on Jul 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: handle provisioned errors gracefully (#682)
Several db operations from websocket clients now handle provisioned exceeded errors more gracefully. Register now returns an error message about the overload so that a client may retry. During the initial notification check, if an error occurs the notification check is re-scheduled to occur at a later time. Finally, if the provision error hits during the monthly change-over, the client remains connected and the migration is re-scheduled. Closes #658
- Loading branch information
Showing
4 changed files
with
261 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class MockAssist(object): | ||
def __init__(self, results): | ||
self.cur = 0 | ||
self.max = len(results) | ||
self.results = results | ||
|
||
def __call__(self, *args, **kwargs): | ||
try: | ||
r = self.results[self.cur] | ||
print r | ||
if callable(r): | ||
return r() | ||
else: | ||
return r | ||
finally: | ||
if self.cur < (self.max - 1): | ||
self.cur += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.