mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 01:00:18 +02:00
Comfort: a state missing 'started' can't crash status (timestamps of 0 still count)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
1203ec0a9e
commit
ab1985b6b3
1 file changed
+2
-1
+2
-1
@@ -183,7 +183,8 @@ def current(s, now):
|
||||
out = dict(s)
|
||||
out['time'] = time.time() # event age uses the Frame's clock, not the phone's
|
||||
out['remaining'] = max(0, max(s.get('deadline', now), (s.get('warned') or 0) + 60) - now) if s.get('active') else 0
|
||||
if s.get('active') and now - (s.get('heartbeat') or s.get('started') or now) > 90:
|
||||
beat = s.get('heartbeat', s.get('started', now)) # a hand-edited state may lack either
|
||||
if s.get('active') and now - beat > 90:
|
||||
out['error'] = 'Session worker is not responding. Timer enforcement is unverified; cancel and start again.'
|
||||
return out
|
||||
|
||||
|
||||
Reference in new issue
Block a user