Skip to content

Commit 954e515

Browse files
authored
Merge pull request #127 from dsmith4-godaddy/dsmith4/verbose_pre_cron
2 parents 55df518 + e72c26c commit 954e515

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

features/cron-event.feature

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,18 @@ Feature: Manage WP Cron events
158158
"""
159159
Debug: Arguments:
160160
"""
161+
162+
Scenario: Confirm that cron event run in debug mode shows the start of events
163+
When I try `wp cron event run wp_version_check --debug=cron`
164+
Then STDOUT should contain:
165+
"""
166+
Executed the cron event 'wp_version_check'
167+
"""
168+
And STDOUT should contain:
169+
"""
170+
Executed a total of 1 cron event
171+
"""
172+
And STDERR should contain:
173+
"""
174+
Debug: Beginning execution of cron event 'wp_version_check'
175+
"""

src/Cron_Event_Command.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ public function run( $args, $assoc_args ) {
243243

244244
$executed = 0;
245245
foreach ( $events as $event ) {
246+
WP_CLI::debug( sprintf( "Beginning execution of cron event '%s'.", $event->hook ), 'cron' );
246247
$start = microtime( true );
247248
$result = self::run_event( $event );
248249
$total = round( microtime( true ) - $start, 3 );

0 commit comments

Comments
 (0)