Browse code

Only write execution to log if there was anything to do

Benjamin Roth authored on22/03/2023 11:24:37
Showing1 changed files
... ...
@@ -132,10 +132,10 @@ class SendNewsNotificationJob
132 132
                         $strNewsIds = implode(',',$arrNewsIds);
133 133
                         $this->db->executeStatement("UPDATE tl_news SET nc_sent = '1' WHERE id IN ($strNewsIds)");
134 134
                     }
135
+
136
+                    $this->logger->log(LogLevel::INFO, 'News notifications has been sent', array('contao' => new ContaoContext(__METHOD__, 'CRON')));
135 137
                 }
136 138
             }
137 139
         }
138
-        $this->logger->log(LogLevel::INFO, 'News notification has been executed', array('contao' => new ContaoContext(__METHOD__, 'CRON')));
139
-
140 140
     }
141 141
 }