feat(ops): add job center for cross-source job operations
Provide a unified ops console for inspecting, retrying and cancelling jobs across generation, template/kol assist, knowledge parse, desktop publish/task, compliance review and monitoring collect sources. Wires RabbitMQ for retry republish and consolidates the desktop_publish_jobs columns into the base migration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,12 @@ CREATE TABLE IF NOT EXISTS desktop_publish_jobs (
|
||||
scheduled_at TIMESTAMPTZ,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
article_id BIGINT REFERENCES articles(id),
|
||||
article_version_id BIGINT REFERENCES article_versions(id),
|
||||
status VARCHAR(32) NOT NULL DEFAULT 'queued',
|
||||
compliance_blocked_record_id BIGINT,
|
||||
compliance_blocked_at TIMESTAMPTZ,
|
||||
compliance_blocked_reason TEXT,
|
||||
UNIQUE (desktop_id)
|
||||
);
|
||||
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
DROP INDEX IF EXISTS idx_desktop_publish_jobs_status_scheduled;
|
||||
|
||||
ALTER TABLE desktop_publish_jobs
|
||||
DROP COLUMN IF EXISTS compliance_blocked_reason,
|
||||
DROP COLUMN IF EXISTS compliance_blocked_at,
|
||||
DROP COLUMN IF EXISTS compliance_blocked_record_id,
|
||||
DROP COLUMN IF EXISTS status,
|
||||
DROP COLUMN IF EXISTS article_version_id,
|
||||
DROP COLUMN IF EXISTS article_id;
|
||||
DROP CONSTRAINT IF EXISTS desktop_publish_jobs_compliance_blocked_record_id_fkey;
|
||||
|
||||
ALTER TABLE article_versions
|
||||
DROP CONSTRAINT IF EXISTS fk_article_versions_manual_review;
|
||||
|
||||
@@ -202,12 +202,13 @@ ALTER TABLE article_versions
|
||||
ON DELETE SET NULL;
|
||||
|
||||
ALTER TABLE desktop_publish_jobs
|
||||
ADD COLUMN IF NOT EXISTS article_id BIGINT REFERENCES articles(id),
|
||||
ADD COLUMN IF NOT EXISTS article_version_id BIGINT REFERENCES article_versions(id),
|
||||
ADD COLUMN IF NOT EXISTS status VARCHAR(32) NOT NULL DEFAULT 'queued',
|
||||
ADD COLUMN IF NOT EXISTS compliance_blocked_record_id BIGINT REFERENCES compliance_check_records(id) ON DELETE SET NULL,
|
||||
ADD COLUMN IF NOT EXISTS compliance_blocked_at TIMESTAMPTZ,
|
||||
ADD COLUMN IF NOT EXISTS compliance_blocked_reason TEXT;
|
||||
DROP CONSTRAINT IF EXISTS desktop_publish_jobs_compliance_blocked_record_id_fkey;
|
||||
|
||||
ALTER TABLE desktop_publish_jobs
|
||||
ADD CONSTRAINT desktop_publish_jobs_compliance_blocked_record_id_fkey
|
||||
FOREIGN KEY (compliance_blocked_record_id)
|
||||
REFERENCES compliance_check_records(id)
|
||||
ON DELETE SET NULL;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_desktop_publish_jobs_status_scheduled
|
||||
ON desktop_publish_jobs (status, scheduled_at, created_at)
|
||||
|
||||
Reference in New Issue
Block a user