Stopping gearman workers nicely

后端 未结 12 897
滥情空心
滥情空心 2021-01-30 04:24

I have a number of Gearman workers running constantly, saving things like records of user page views, etc. Occasionally, I\'ll update the PHP code that is used by the Gearman w

12条回答
  •  逝去的感伤
    2021-01-30 04:34

    function AutoRestart() {
       static $startTime = time();
    
       if (filemtime(__FILE__) > $startTime) {
          exit();
       }
    }
    
    AutoRestart();  
    

提交回复
热议问题