]> _ Git - fluidbook-toolbox.git/commitdiff
wip #8068 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 17 Mar 2026 15:41:51 +0000 (16:41 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 17 Mar 2026 15:41:51 +0000 (16:41 +0100)
app/Jobs/AuditLink.php

index eacf5adce7ad6f7e2a01aa2b51a3e8b31e0682dc..6f02bfa85672ec01f5ce452aa69a314bf00544d8 100644 (file)
@@ -16,14 +16,16 @@ class AuditLink extends Base
     protected $_batchSize = 500;
     protected $_url = null;
     protected static $minTimeBetweenRequests = 2;
+    protected $_log = false;
 
     /**
      * Create a new job instance.
      */
-    public function __construct($batchSize = 500, $url = null)
+    public function __construct($batchSize = 500, $url = null, $log = false)
     {
         $this->_batchSize = $batchSize;
         $this->_url = $url;
+        $this->_log = $log;
     }
 
     public function handle()
@@ -73,7 +75,9 @@ class AuditLink extends Base
             } else {
                 $res = HTTP::getResponseCode($url, 10, 'http://paris.cubedesigners.com:8191/v1');
             }
-            Log::info('Tested ' . $url . ': ' . $res['http_code']);
+            if ($this->_log) {
+                Log::info('Tested ' . $url . ': ' . $res['http_code']);
+            }
 
             if ($res['http_code'] != $previousCode) {
                 $res['code_date'] = new \DateTime();