database lock for frequent processes
authorAlan <alan@roojs.com>
Wed, 3 Apr 2024 03:30:54 +0000 (11:30 +0800)
committerAlan <alan@roojs.com>
Wed, 3 Apr 2024 03:30:54 +0000 (11:30 +0800)
Heartbeat.php
Notify.php
NotifySend.php

index 6a49092..27c1bf8 100644 (file)
@@ -20,6 +20,12 @@ class Pman_Core_Heartbeat extends Pman
     function post($req)
     {
         $this->initErrorHandling();
+        
+        if ($this->database_is_locked()) {
+            die("FAILED");
+        }
+        
+        
         $cd = DB_DataObject::Factory('core_enum');
         $cd->setFrom(array(
             'etype' => 'heartbeat',
@@ -48,4 +54,6 @@ class Pman_Core_Heartbeat extends Pman
       //  print_r($err);
         die("FAILED");
     }
+    
+   
 }
\ No newline at end of file
index f524ff2..55047c7 100644 (file)
@@ -178,6 +178,12 @@ class Pman_Core_Notify extends Pman
    
     function get($r,$opts=array())    
     {
+        
+        if ($this->database_is_locked()) {
+            die("LATER - DATABASE IS LOCKED");
+        }
+        
+        
         $this->parseArgs($opts); 
          
         //date_default_timezone_set('UTC');
index 0ba7692..a7b6874 100644 (file)
@@ -87,7 +87,9 @@ class Pman_Core_NotifySend extends Pman
    
     function get($id,$opts=array())
     {
-
+        if ($this->database_is_locked()) {
+            die("LATER - DATABASE IS LOCKED");
+        }
         //print_r($opts);
         if (!empty($opts['DB_DataObject-debug'])) {
             DB_DataObject::debugLevel($opts['DB_DataObject-debug']);