feat(railiance): adopt state-hub edge relay beachhead for WP-0015
Deploy actcore-statehub-edge-relay, point STATE_HUB_URL at it, retire the bespoke state-hub bridge, and accept edge-relay queued write receipts in report and ops evidence sinks.
This commit is contained in:
parent
1a0636845a
commit
cdbe4de2bf
13 changed files with 256 additions and 136 deletions
|
|
@ -24,7 +24,7 @@ from uuid import UUID
|
|||
import httpx
|
||||
|
||||
from activity_core.schedule_manager import schedule_id
|
||||
from activity_core.state_hub_write import idempotency_headers
|
||||
from activity_core.state_hub_write import idempotency_headers, parse_state_hub_write_response
|
||||
|
||||
_DEFAULT_STATE_HUB_URL = "http://127.0.0.1:8000"
|
||||
|
||||
|
|
@ -187,8 +187,14 @@ def post_missed_fire_alert(
|
|||
headers=idempotency_headers("schedule_miss", health.activity_id, last_fired),
|
||||
timeout=timeout_seconds,
|
||||
)
|
||||
resp.raise_for_status()
|
||||
data = resp.json()
|
||||
data = parse_state_hub_write_response(resp)
|
||||
if data.get("queued"):
|
||||
return {
|
||||
"type": "schedule-miss-alert",
|
||||
"status": "queued",
|
||||
"outbox_id": data.get("outbox_id"),
|
||||
"idempotency_key": data.get("idempotency_key"),
|
||||
}
|
||||
return {
|
||||
"type": "schedule-miss-alert",
|
||||
"status": "posted",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue