reduce frequency of heatbeat
authorAlan <alan@roojs.com>
Tue, 16 Apr 2024 02:33:27 +0000 (10:33 +0800)
committerAlan <alan@roojs.com>
Tue, 16 Apr 2024 02:33:27 +0000 (10:33 +0800)
Heartbeat.php

index 27c1bf8..b95c3be 100644 (file)
@@ -38,6 +38,10 @@ class Pman_Core_Heartbeat extends Pman
         }
         $cd->find(true);
         $cc = clone($cd);
+        if ( (time() - strtotime($cc->display_name)) < 30) {
+            die("OK - HEATBEAT TO FREQUENT");
+        }
+        
         $cd->display_name = date("Y-m-d H:i:s");
         $cd->update($cc);
         die("OK - HEARTBEAT WORKING");