Improve notification reliability with handler retries and post-success ID marking

This commit is contained in:
Oussema Bouafif
2026-02-14 14:54:23 +01:00
parent 19bd8976ce
commit 432b962d23
2 changed files with 42 additions and 8 deletions

View File

@@ -26,11 +26,14 @@ class ID:
logger.exception("An error occurred while attempting to open the id.json file.")
return ids
def add(self, id: str) -> bool:
if not id in self._ids:
self._ids.append(id)
def contains(self, id_: str) -> bool:
return id_ in self._ids
def add(self, id_: str) -> bool:
if not id_ in self._ids:
self._ids.append(id_)
with open("id.json", "w") as f:
json.dump(self._ids[-MAX_ID:], f, indent=3)
self._ids = self._ids[-MAX_ID:]
return True
return False
return False