feat: harden multi-host runtime coordination

This commit is contained in:
2026-08-02 05:30:11 +02:00
parent b58c9c55cf
commit d6255f9f8f
7 changed files with 92 additions and 7 deletions
@@ -166,9 +166,7 @@ def runtime_identity(
for item in str(getattr(settings, "celery_queues", "") or "").split(",")
if item.strip()
)
composition_hash = hashlib.sha256(
json.dumps(sorted(module_ids), separators=(",", ":")).encode("utf-8")
).hexdigest()
composition_hash = runtime_composition_hash(module_ids)
return RuntimeIdentity(
installation_id=installation_id,
node_id=effective_node_id,
@@ -180,6 +178,12 @@ def runtime_identity(
)
def runtime_composition_hash(module_ids: tuple[str, ...]) -> str:
return hashlib.sha256(
json.dumps(sorted(set(module_ids)), separators=(",", ":")).encode("utf-8")
).hexdigest()
def register_runtime_node(
session: Session,
identity: RuntimeIdentity,