Skip to content

Commit 34c0916

Browse files
authored
fix: remove dual retry path in check_pending_site_created (#797)
When a stale is_publishing flag is detected and reset, the code was both enqueuing wu_async_publish_pending_site via Action Scheduler AND returning publish_status=stopped to the frontend. This created two competing retry sources that could trigger double site creation. Remove the wu_enqueue_async_action call. The frontend polling loop retries on 'stopped' status, and the existing AS scheduled action will pick up the reset flag on its next run — a single retry path is sufficient. Fixes #793
1 parent 3d73e0f commit 34c0916

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

inc/managers/class-membership-manager.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,13 @@ public function check_pending_site_created() {
219219
);
220220

221221
/*
222-
* Re-enqueue the async action so Action Scheduler retries
223-
* the site creation without waiting for the next cron tick.
222+
* Return 'stopped' so the frontend polling loop retries.
223+
* Do NOT also enqueue wu_async_publish_pending_site here —
224+
* that would create two competing retry sources (Action
225+
* Scheduler + frontend) and risk double site creation.
226+
* The existing AS scheduled action will pick up the reset
227+
* flag on its next run.
224228
*/
225-
wu_enqueue_async_action('wu_async_publish_pending_site', ['membership_id' => $membership->get_id()], 'membership');
226-
227229
wp_send_json(['publish_status' => 'stopped']);
228230

229231
exit;

0 commit comments

Comments
 (0)