feat: M4 in-admin manual generation on chained-cron checkpoints + IA/perf pass (v0.21.0) (#166)
Final Phase 2 admin milestone. Board "New Article" runs through the M3 chained-cron checkpoint state machine (one stage/idea per tick, queue persisted before generate, lock released on every exit path) so generation survives Hostinger background-kill; retires the SSH-only do_action workaround (WP-CLI routes through the same entry). IA/perf: settings-backed board/ideas pagination + db 1.4.0 indexes. Folds guard P2s (--self-test + window doc). QA: APPROVE-WITH-P2-NOTES @f2a00d4+ delta APPROVE @0c8071f. Deferred (tracked): class-admin-page.php 353-line split + pagination Settings-UI fields. Agent-Session: phase2-admin-m4-20260614
This commit is contained in:
@@ -103,4 +103,41 @@ class PRAutoBlogger_Pipeline_Status {
|
||||
'pipeline'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Write an initial "running" status before the first tick fires.
|
||||
* Mirrors the shape on_ajax_generate_now() already writes so the poller
|
||||
* sees a consistent "running" state whether triggered from board or settings page.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function write_initial(): void {
|
||||
set_transient(
|
||||
self::KEY,
|
||||
array(
|
||||
'status' => 'running',
|
||||
'stage' => __( 'Starting generation…', 'prautoblogger' ),
|
||||
'started' => time(),
|
||||
'last_updated' => time(),
|
||||
),
|
||||
self::TTL
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a terminal "error" status.
|
||||
*
|
||||
* @param string $message Operator-facing error description.
|
||||
* @return void
|
||||
*/
|
||||
public static function write_error( string $message ): void {
|
||||
set_transient(
|
||||
self::KEY,
|
||||
array(
|
||||
'status' => 'error',
|
||||
'message' => $message,
|
||||
),
|
||||
self::TTL
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user