mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-07-14 01:41:25 -06:00
chore: Improves session update time validation message (#446)
Enhances the error message when a session's last update time is later than the storage update time. This provides better readability by formatting the timestamps in the error message. Co-authored-by: Hangfei Lin <hangfei@google.com>
This commit is contained in:
parent
c74879d849
commit
24024f7fc4
@ -484,9 +484,11 @@ class DatabaseSessionService(BaseSessionService):
|
|||||||
|
|
||||||
if storage_session.update_time.timestamp() > session.last_update_time:
|
if storage_session.update_time.timestamp() > session.last_update_time:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"Session last_update_time {session.last_update_time} is later than"
|
f"Session last_update_time "
|
||||||
f" the upate_time in storage {storage_session.update_time}"
|
f"{datetime.fromtimestamp(session.last_update_time):%Y-%m-%d %H:%M:%S} "
|
||||||
)
|
f"is later than the update_time in storage "
|
||||||
|
f"{storage_session.update_time:%Y-%m-%d %H:%M:%S}"
|
||||||
|
)
|
||||||
|
|
||||||
# Fetch states from storage
|
# Fetch states from storage
|
||||||
storage_app_state = sessionFactory.get(
|
storage_app_state = sessionFactory.get(
|
||||||
|
Loading…
Reference in New Issue
Block a user