SysOps: deploy-all — 2026-06-09 10:41 UTC
This commit is contained in:
@@ -244,7 +244,14 @@ def test_connection(platform: str, integration: dict[str, Any] | None = None) ->
|
||||
return {"ok": True, "status": "ok", "message": f"{platform} configuration is present"}
|
||||
|
||||
|
||||
def run_publish_job(job_id: int, text: str, channels: list[str], image_url: str | None, media_ids: list[int]) -> None:
|
||||
def run_publish_job(
|
||||
job_id: int,
|
||||
text: str,
|
||||
channels: list[str],
|
||||
image_url: str | None,
|
||||
media_ids: list[int],
|
||||
project_id: int | None = None,
|
||||
) -> None:
|
||||
started_at = datetime.utcnow()
|
||||
execute(
|
||||
"UPDATE social_publish_jobs SET status=%s, started_at=NOW(), updated_at=NOW() WHERE id=%s",
|
||||
@@ -310,5 +317,26 @@ def run_publish_job(job_id: int, text: str, channels: list[str], image_url: str
|
||||
title=f"Social publish job #{job_id} afgerond",
|
||||
body=f"Published={published}, skipped={skipped}, failed={failed}",
|
||||
status=final_status,
|
||||
metadata={"job_id": job_id, "results": results},
|
||||
metadata={"job_id": job_id, "results": results, "project_id": project_id},
|
||||
)
|
||||
|
||||
try:
|
||||
from app.services import projects as project_svc
|
||||
|
||||
project_svc.register_agent_output(
|
||||
asset_type="social_publish",
|
||||
title=f"Social publish #{job_id} · {final_status}",
|
||||
ref_id=str(job_id),
|
||||
payload={
|
||||
"job_id": job_id,
|
||||
"status": final_status,
|
||||
"channels": channels,
|
||||
"published": published,
|
||||
"text_preview": (text or "")[:200],
|
||||
},
|
||||
project_id=project_id,
|
||||
source_agent="marketing",
|
||||
created_by="marketing_automation",
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user