Correct unknown upload reconciliation and allow longer upload response
This commit is contained in:
@@ -703,6 +703,11 @@ class DisplayService:
|
||||
device = driver.device(refresh=True)
|
||||
images = driver.images()
|
||||
expected = (op["result"] or {}).get("image_id")
|
||||
confirmed = (
|
||||
bool(expected)
|
||||
and expected == device.current_content.id
|
||||
and device.current_content.synced
|
||||
)
|
||||
resolved = op["status"] != "UNKNOWN"
|
||||
if op["status"] == "UNKNOWN" and (
|
||||
acknowledge
|
||||
@@ -715,7 +720,7 @@ class DisplayService:
|
||||
# Acknowledge releases the block; it never resends a write.
|
||||
self.update(
|
||||
id,
|
||||
"COMPLETED" if expected == device.current_content.id else "FAILED",
|
||||
"COMPLETED" if confirmed else "FAILED",
|
||||
{"image_id": device.current_content.id},
|
||||
)
|
||||
resolved = True
|
||||
@@ -727,9 +732,7 @@ class DisplayService:
|
||||
device_id=op["device_id"],
|
||||
action="reconcile",
|
||||
),
|
||||
"CONFIRMED"
|
||||
if expected == device.current_content.id
|
||||
else "ACKNOWLEDGED",
|
||||
"CONFIRMED" if confirmed else "ACKNOWLEDGED",
|
||||
)
|
||||
return dict(
|
||||
operation_id=id,
|
||||
|
||||
@@ -48,7 +48,7 @@ class SafeTransport:
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
json=None if binary else payload or {},
|
||||
timeout=(5, 30),
|
||||
timeout=(5, 120 if endpoint == "/upload" else 30),
|
||||
allow_redirects=False,
|
||||
)
|
||||
except requests.RequestException:
|
||||
|
||||
Reference in New Issue
Block a user