From 569661a25c41fc520adc52f8c21d4139bd49c8c8 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Tue, 6 Mar 2018 14:26:42 +0100 Subject: [PATCH] memcache: revert commit for the backend job --- .../modules/thread/CronjobController.php | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/web/yaamp/modules/thread/CronjobController.php b/web/yaamp/modules/thread/CronjobController.php index 723c7ad80..4af398266 100644 --- a/web/yaamp/modules/thread/CronjobController.php +++ b/web/yaamp/modules/thread/CronjobController.php @@ -18,7 +18,7 @@ private function monitorApache() $uptime = exec('uptime'); - $apache_locked = $this->memcache->get('apache_locked'); + $apache_locked = memcache_get($this->memcache->memcache, 'apache_locked'); if($apache_locked) return; $b = preg_match('/load average: (.*)$/', $uptime, $m); @@ -52,7 +52,7 @@ public function actionRunBlocks() $this->monitorApache(); - $last_complete = $this->memcache->get("cronjob_block_time_start"); + $last_complete = memcache_get($this->memcache->memcache, "cronjob_block_time_start"); if($last_complete+(5*60) < time()) dborun("update jobs set active=false"); @@ -62,7 +62,7 @@ public function actionRunBlocks() BackendProcessList(); BackendBlocksUpdate(); - $this->memcache->set("cronjob_block_time_start", time()); + memcache_set($this->memcache->memcache, "cronjob_block_time_start", time()); // debuglog(__METHOD__); } @@ -82,21 +82,21 @@ public function actionRunLoop2() MonitorBTC(); - $last = $this->memcache->get('last_renting_payout2'); + $last = memcache_get($this->memcache->memcache, 'last_renting_payout2'); if($last + 5*60 < time()) { - $this->memcache->set('last_renting_payout2', time()); + memcache_set($this->memcache->memcache, 'last_renting_payout2', time()); BackendRentingPayout(); } - $last = $this->memcache->get('last_stats2'); + $last = memcache_get($this->memcache->memcache, 'last_stats2'); if($last + 5*60 < time()) { - $this->memcache->set('last_stats2', time()); + memcache_set($this->memcache->memcache, 'last_stats2', time()); BackendStatsUpdate2(); } - $this->memcache->set("cronjob_loop2_time_start", time()); + memcache_set($this->memcache->memcache, "cronjob_loop2_time_start", time()); // debuglog(__METHOD__); } @@ -107,11 +107,11 @@ public function actionRun() // BackendRunCoinActions(); - $state = $this->memcache->get('cronjob_main_state'); + $state = memcache_get($this->memcache->memcache, 'cronjob_main_state'); if(!$state) $state = 0; - $this->memcache->set('cronjob_main_state', $state+1); - $this->memcache->set("cronjob_main_state_$state", 1); + memcache_set($this->memcache->memcache, 'cronjob_main_state', $state+1); + memcache_set($this->memcache->memcache, "cronjob_main_state_$state", 1); switch($state) { @@ -177,20 +177,20 @@ public function actionRun() break; default: - $this->memcache->set('cronjob_main_state', 0); + memcache_set($this->memcache->memcache, 'cronjob_main_state', 0); BackendQuickClean(); - $t = $this->memcache->get("cronjob_main_start_time"); + $t = memcache_get($this->memcache->memcache, "cronjob_main_start_time"); $n = time(); - $this->memcache->set("cronjob_main_time", $n-$t); - $this->memcache->set("cronjob_main_start_time", $n); + memcache_set($this->memcache->memcache, "cronjob_main_time", $n-$t); + memcache_set($this->memcache->memcache, "cronjob_main_start_time", $n); } debuglog(__METHOD__." $state"); - $this->memcache->set("cronjob_main_state_$state", 0); + memcache_set($this->memcache->memcache, "cronjob_main_state_$state", 0); - $this->memcache->set("cronjob_main_time_start", time()); + memcache_set($this->memcache->memcache, "cronjob_main_time_start", time()); if(!YAAMP_PRODUCTION) return; /////////////////////////////////////////////////////////////////// @@ -203,14 +203,14 @@ public function actionRun() $mining->last_payout = time(); $mining->save(); - $this->memcache->set('apache_locked', true); + memcache_set($this->memcache->memcache, 'apache_locked', true); if(YAAMP_USE_NGINX) system("service nginx stop"); sleep(10); BackendDoBackup(); - $this->memcache->set('apache_locked', false); + memcache_set($this->memcache->memcache, 'apache_locked', false); BackendPayments(); BackendCleanDatabase();