Skip to content

Commit

Permalink
Try again in 15s if error returned from /v3/sync
Browse files Browse the repository at this point in the history
  • Loading branch information
luk3yx committed Nov 17, 2022
1 parent c184810 commit 1a0d644
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion miniirc_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import miniirc, requests, traceback # type: ignore


ver = (0, 0, 7)
ver = (0, 0, 8)
__version__ = '.'.join(map(str, ver))


Expand Down Expand Up @@ -495,6 +495,14 @@ def _main(self) -> None:
if self.debug_file:
self.debug(json.dumps(res, indent=4))
if 'error' in res:
# TODO: Use self.debug or something
print(f'[miniirc_matrix] Error returned when trying to '
f'fetch /sync: {res["error"]!r}')

if self.persist:
self.debug('Trying again in 15 seconds...')
time.sleep(15)
continue
break
next_batch = res['next_batch']
if 'rooms' in res:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='miniirc_matrix',
version='0.0.7',
version='0.0.8',
py_modules=['miniirc_matrix'],
author='luk3yx',
description='A Matrix wrapper for miniirc.',
Expand Down

0 comments on commit 1a0d644

Please sign in to comment.