Skip to content

Commit 1a0d644

Browse files
committed
Try again in 15s if error returned from /v3/sync
1 parent c184810 commit 1a0d644

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Diff for: miniirc_matrix.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import miniirc, requests, traceback # type: ignore
1313

1414

15-
ver = (0, 0, 7)
15+
ver = (0, 0, 8)
1616
__version__ = '.'.join(map(str, ver))
1717

1818

@@ -495,6 +495,14 @@ def _main(self) -> None:
495495
if self.debug_file:
496496
self.debug(json.dumps(res, indent=4))
497497
if 'error' in res:
498+
# TODO: Use self.debug or something
499+
print(f'[miniirc_matrix] Error returned when trying to '
500+
f'fetch /sync: {res["error"]!r}')
501+
502+
if self.persist:
503+
self.debug('Trying again in 15 seconds...')
504+
time.sleep(15)
505+
continue
498506
break
499507
next_batch = res['next_batch']
500508
if 'rooms' in res:

Diff for: setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name='miniirc_matrix',
8-
version='0.0.7',
8+
version='0.0.8',
99
py_modules=['miniirc_matrix'],
1010
author='luk3yx',
1111
description='A Matrix wrapper for miniirc.',

0 commit comments

Comments
 (0)