From f7ce09e7763961ff8345038e2d29d03a5e3829eb Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Fri, 30 Aug 2024 15:57:52 +0100
Subject: [PATCH] Redirect "wp cron" stderr to /dev/null

Reduce the cron noise from (apparently) wp including wp-config
twice, which generates lots of "Constant already defined" warnings.
---
 lib/cron.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/cron.php b/lib/cron.php
index 4148ee7..0d8f86d 100644
--- a/lib/cron.php
+++ b/lib/cron.php
@@ -57,7 +57,7 @@ function noblogs_run_cron_for_current_blog() {
     $blog_details = get_blog_details(null, false);
     $domain = $blog_details->domain;
     echo "  executing wp-cli for unsafe hooks ({$domain})\n";
-    system("wp cron event run --due-now --url={$domain}", $retval);
+    system("wp cron event run --due-now --url={$domain} 2>/dev/null", $retval);
     if ($retval != 0) {
         error_log("error executing wp-cli cron runner for blog {$domain}");
     }
-- 
GitLab