fix: Support short session idle durations (#36773)

closes https://github.com/frappe/frappe/issues/35209
This commit is contained in:
Ankush Menat 2026-02-06 12:16:19 +05:30 committed by GitHub
parent b39800e5aa
commit 4e91b1a281
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -416,10 +416,12 @@ class Session:
last_updated = self.data.data.last_updated
time_diff = frappe.utils.time_diff_in_seconds(now, last_updated) if last_updated else None
threshold = min(get_expiry_in_seconds() / 2, 600) or 600
# database persistence is secondary, don't update it too often
updated_in_db = False
if (
force or (time_diff is None) or (time_diff > 600) or self._update_in_cache
force or (time_diff is None) or (time_diff > threshold) or self._update_in_cache
) and not frappe.flags.read_only:
self.data.data.last_updated = now
self.data.data.lang = str(frappe.lang)