fix(B3): _honeymoon_expired Race-Schutz — prüft pending_status unter Lock
This commit is contained in:
@@ -322,6 +322,17 @@ class PresenceEngine:
|
||||
active = self._active_tasks
|
||||
|
||||
if active == 0:
|
||||
# B3: Race-Schutz — prüfe ob pending_status 'busy' ist.
|
||||
# mark_busy_started könnte parallel update_presence() mit
|
||||
# pending='busy' aufgerufen haben. Dann NICHT überschreiben.
|
||||
with self._coalesce_lock:
|
||||
pending = self._pending_status
|
||||
if pending == "busy":
|
||||
logger.debug(
|
||||
"[presence] Honeymoon-Timer abgelaufen, aber pending_status=busy — "
|
||||
"nicht überschreiben (Race-Schutz)"
|
||||
)
|
||||
return
|
||||
# B2: Reset _busy_started_at when honeymoon fully expires
|
||||
# and no active tasks remain — next busy cycle starts fresh.
|
||||
self._busy_started_at = 0.0
|
||||
|
||||
Reference in New Issue
Block a user