Skip to content

Commit

Permalink
Limit RTS message size
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Feb 19, 2025
1 parent 27216f0 commit e6cde2a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion odds/common/realtime_status/peewee/peewee_rts.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ def __init__(self) -> None:

def set(self, ctx: str, message: str, kind='info') -> None:
params = dict(
message=message[:254],
message=message,
kind=kind,
updated=datetime.datetime.now()
)
ctx = ctx[:254]
StatusModel.insert(ctx=ctx, **params)\
.on_conflict('update', update=params, conflict_target=(StatusModel.ctx,))\
.execute()
Expand Down

0 comments on commit e6cde2a

Please sign in to comment.