File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -252,8 +252,8 @@ Feature: Manage WP Cron events
252252 Success: Scheduled event with hook 'wp_cli_test_event_lock'
253253 """
254254
255- # Simulate an in-progress WP-CLI cron run by setting the wp_cli_doing_cron transient.
256- When I run `wp eval 'set_transient( "wp_cli_doing_cron ", sprintf( "%.22F", microtime( true ) ) );' `
255+ # Simulate an in-progress cron run by setting the doing_cron transient.
256+ When I run `wp eval 'set_transient( "doing_cron ", sprintf( "%.22F", microtime( true ) ) );' `
257257
258258 And I try `wp cron event run --due-now`
259259 Then STDERR should contain:
@@ -266,7 +266,7 @@ Feature: Manage WP Cron events
266266 """
267267
268268 # After the transient is cleared, the run should proceed normally.
269- When I run `wp eval 'delete_transient( "wp_cli_doing_cron " );' `
269+ When I run `wp eval 'delete_transient( "doing_cron " );' `
270270 And I try `wp cron event run --due-now`
271271 Then STDOUT should contain:
272272 """
Original file line number Diff line number Diff line change @@ -248,19 +248,19 @@ public function run( $args, $assoc_args ) {
248248
249249 if ( $ due_now ) {
250250 $ lock_timeout = defined ( 'WP_CRON_LOCK_TIMEOUT ' ) ? WP_CRON_LOCK_TIMEOUT : 60 ;
251- $ doing_cron_transient = get_transient ( 'wp_cli_doing_cron ' );
251+ $ doing_cron_transient = get_transient ( 'doing_cron ' );
252252 if ( is_numeric ( $ doing_cron_transient ) && (float ) $ doing_cron_transient > microtime ( true ) - $ lock_timeout ) {
253253 WP_CLI ::warning ( 'A cron event run is already in progress; skipping. ' );
254254 return ;
255255 }
256- set_transient ( 'wp_cli_doing_cron ' , sprintf ( '%.22F ' , microtime ( true ) ) );
256+ set_transient ( 'doing_cron ' , sprintf ( '%.22F ' , microtime ( true ) ) );
257257 }
258258
259259 $ events = self ::get_selected_cron_events ( $ args , $ assoc_args );
260260
261261 if ( is_wp_error ( $ events ) ) {
262262 if ( $ due_now ) {
263- delete_transient ( 'wp_cli_doing_cron ' );
263+ delete_transient ( 'doing_cron ' );
264264 }
265265 WP_CLI ::error ( $ events );
266266 }
@@ -279,7 +279,7 @@ public function run( $args, $assoc_args ) {
279279 }
280280
281281 if ( $ due_now ) {
282- delete_transient ( 'wp_cli_doing_cron ' );
282+ delete_transient ( 'doing_cron ' );
283283 }
284284
285285 $ message = ( 1 === $ executed ) ? 'Executed a total of %d cron event. ' : 'Executed a total of %d cron events. ' ;
You can’t perform that action at this time.
0 commit comments