compare view
This commit is contained in:
@@ -39,13 +39,21 @@ def checkpoint_after_stage(job_id: str, stage_name: str, state: dict, result: di
|
||||
return
|
||||
|
||||
from .storage import save_checkpoint, save_stage_output
|
||||
from core.detect.stages.base import _REGISTRY
|
||||
from core.detect.stages.base import _REGISTRY, _LEGACY_REGISTRY
|
||||
|
||||
merged = {**state, **result}
|
||||
|
||||
# Serialize stage output using the stage's serialize_fn if available
|
||||
# Check new-style registry first, then legacy (some stages are in both)
|
||||
serialize_fn = None
|
||||
stage_cls = _REGISTRY.get(stage_name)
|
||||
serialize_fn = getattr(getattr(stage_cls, "definition", None), "serialize_fn", None)
|
||||
if stage_cls:
|
||||
serialize_fn = getattr(getattr(stage_cls, "definition", None), "serialize_fn", None)
|
||||
if not serialize_fn:
|
||||
legacy = _LEGACY_REGISTRY.get(stage_name)
|
||||
if legacy:
|
||||
serialize_fn = legacy.serialize_fn
|
||||
|
||||
if serialize_fn:
|
||||
output_json = serialize_fn(merged, job_id)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user