added reminder
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.homelab.state import get_state, set_state
|
||||
|
||||
NOTIFY_SEQ_KEY = "reminders_notify_seq"
|
||||
|
||||
|
||||
def get_notify_seq(db: Session) -> int:
|
||||
raw = get_state(db, NOTIFY_SEQ_KEY)
|
||||
try:
|
||||
return int(raw or 0)
|
||||
except ValueError:
|
||||
return 0
|
||||
|
||||
|
||||
def bump_notify_seq(db: Session) -> int:
|
||||
seq = get_notify_seq(db) + 1
|
||||
set_state(db, NOTIFY_SEQ_KEY, str(seq))
|
||||
return seq
|
||||
Reference in New Issue
Block a user