fix: defer background cleanup until pending display is confirmed
This commit is contained in:
@@ -518,11 +518,11 @@ class DisplayService:
|
||||
) and self.blocked(op["device_id"]):
|
||||
continue
|
||||
payload = json.loads(op["payload"])
|
||||
if op["action"] == "display":
|
||||
if op["client_id"] in (
|
||||
"scheduler",
|
||||
"scheduler-retry",
|
||||
) and self.db.one(
|
||||
if (
|
||||
op["action"] in ("display", "delete", "restore")
|
||||
and op["client_id"]
|
||||
in ("scheduler", "scheduler-retry", "cloud-library", "retention")
|
||||
and self.db.one(
|
||||
"SELECT id FROM operations WHERE device_id=? AND action='display' "
|
||||
"AND status='SYNCING' AND write_started=1 AND updated_at>? LIMIT 1",
|
||||
(
|
||||
@@ -532,10 +532,12 @@ class DisplayService:
|
||||
- timedelta(seconds=self.settings.sync_timeout)
|
||||
).isoformat(),
|
||||
),
|
||||
):
|
||||
# Upload activates a new image upstream. Give the prior
|
||||
# image its existing confirmation window before replacing it.
|
||||
continue
|
||||
)
|
||||
):
|
||||
# Both upload and deletion update the cloud frame counter.
|
||||
# Automatic writes must not invalidate a pending display ack.
|
||||
continue
|
||||
if op["action"] == "display":
|
||||
priority = payload["options"]["priority"]
|
||||
top = self.top(op["device_id"])
|
||||
if top and priority < top["priority"]:
|
||||
|
||||
Reference in New Issue
Block a user