Conditions | 5 |
Paths | 8 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | public function clearAllLogs($is_job = false) |
||
13 | { |
||
14 | $enabled = false; |
||
15 | $config = config('laravel-job-handler.clear_log_after_seconds', null); |
||
16 | $as_job = config('laravel-job-handler.clear_log_via_job', false); |
||
17 | |||
18 | if ($as_job && !$is_job) { |
||
19 | //dispatch(new ) |
||
20 | } |
||
21 | |||
22 | if (!is_null($config)) { |
||
23 | $enabled = true; |
||
24 | } |
||
25 | |||
26 | if ($enabled) { |
||
27 | $this->clearAllLogsBefore(Carbon::now()->subSeconds($config)); |
||
28 | } else { |
||
29 | //deleting of old logs is disabled |
||
44 |