Skip to content
Snippets Groups Projects
Commit eecfa36a authored by ale's avatar ale
Browse files

Fix error_log() invocations and blog domain

parent 49d28021
No related branches found
No related tags found
No related merge requests found
Pipeline #43760 passed
......@@ -35,15 +35,17 @@ function noblogs_run_cron_for_current_blog() {
if ($schedule) {
$result = wp_reschedule_event($timestamp, $schedule, $hook, $v['args'], true);
if (is_wp_error($result)) {
error_log('cron reschedule event error for hook: %1$s, code: %2$s, message: %3$s, data: %4$s',
$hook, $result->get_error_code(), $result->get_error_message(), wp_json_encode($v));
error_log(sprintf(
'cron reschedule event error for hook: %1$s, code: %2$s, message: %3$s, data: %4$s',
$hook, $result->get_error_code(), $result->get_error_message(), wp_json_encode($v)));
do_action('cron_reschedule_event_error', $result, $hook, $v);
}
}
$result = wp_unschedule_event($timestamp, $hook, $v['args'], true);
if (is_wp_error($result)) {
error_log('cron unschedule event error for hook: %1$s, code: %2$s, message: %3$s, data: %4$s',
$hook, $result->get_error_code(), $result->get_error_message(), wp_json_encode($v));
error_log(sprintf(
'cron unschedule event error for hook: %1$s, code: %2$s, message: %3$s, data: %4$s',
$hook, $result->get_error_code(), $result->get_error_message(), wp_json_encode($v)));
do_action('cron_unschedule_event_error', $result, $hook, $v);
}
do_action_ref_array($hook, $v['args']);
......@@ -52,7 +54,8 @@ function noblogs_run_cron_for_current_blog() {
}
if ($has_unsafe_hooks) {
$domain = get_option('domain');
$blog_details = get_blog_details(null, false);
$domain = $blog_details->domain;
echo " executing wp-cli for unsafe hooks ({$domain})";
system("wp cron event run --due-now --url={$domain}");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment