feat: add clear method to StoredInt and StoredCounter classes

This commit is contained in:
2026-07-06 22:40:31 +08:00
parent b029d9f732
commit be70c88036
2 changed files with 18 additions and 13 deletions
+6
View File
@@ -134,6 +134,9 @@ class StoredExpiredAtMonday0400(StoredBase):
class StoredInt(StoredBase):
value = 0
def clear(self):
self.value = 0
class StoredCounter(StoredBase):
value = 0
@@ -148,6 +151,9 @@ class StoredCounter(StoredBase):
self.value = value
self.total = total
def clear(self):
self.value = 0
def to_counter(self) -> str:
return f'{self.value}/{self.total}'