File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ protected function sendEmail($message): void
109109
110110 self ::writeToLogFile ($ errorSnoozeLog , $ line . ' ' . $ messageHash );
111111
112- // MAX EMAILS PER DY
112+ // MAX EMAILS PER DAY
113113
114114 $ maxEmailsPerDayLog = $ this ->directory . '/max-emails-per-day.log ' ;
115115
@@ -118,16 +118,16 @@ protected function sendEmail($message): void
118118 @unlink ($ maxEmailsPerDayLog );
119119 }
120120
121- $ logContent = @file_get_contents ($ errorSnoozeLog );
121+ $ logContent = @file_get_contents ($ maxEmailsPerDayLog );
122122
123- if (substr_count ($ logContent , date ('Y-m-d ' )) >= $ this ->maxEmailsPerDay ) {
123+ file_put_contents ('adasd ' , count (file ($ maxEmailsPerDayLog )));
124+
125+ if (count (file ($ maxEmailsPerDayLog )) >= $ this ->maxEmailsPerDay ) {
124126 // Limit per day exceeded
125127 return ;
126128 }
127129
128- if (!@file_put_contents ($ errorSnoozeLog , $ line . ' ' . $ messageHash . PHP_EOL , FILE_APPEND | LOCK_EX )) {
129- throw new RuntimeException ("Unable to write to log file ' " . $ errorSnoozeLog . "'. Is directory writable? " );
130- }
130+ self ::writeToLogFile ($ maxEmailsPerDayLog , $ line . ' ' . $ messageHash );
131131
132132 // SEND EMAIL
133133
You can’t perform that action at this time.
0 commit comments