|
@@ -18,7 +18,7 @@ class minutesControl extends BaseCronControl
|
|
|
Log::record(__FUNCTION__ . " start",Log::DEBUG);
|
|
|
//未付款订单超期自动关闭
|
|
|
$this->_order_timeout_cancel();
|
|
|
- $this->_cron_common();
|
|
|
+ $this->_cron_common([1,2,3,4,5,6,7]);
|
|
|
$this->_web_index_update();
|
|
|
$this->_check_merchant_alarm_amount();
|
|
|
$this->check_refill_order_limit();
|
|
@@ -262,15 +262,23 @@ class minutesControl extends BaseCronControl
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public function second_queueOp()
|
|
|
+ {
|
|
|
+ while (true) {
|
|
|
+ $this->_cron_common([8]);
|
|
|
+ sleep(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 执行通用任务
|
|
|
*/
|
|
|
- private function _cron_common()
|
|
|
+ private function _cron_common($types)
|
|
|
{
|
|
|
Log::record(__FUNCTION__,Log::DEBUG);
|
|
|
//查找待执行任务
|
|
|
$model_cron = Model('cron');
|
|
|
- $cron = $model_cron->getCronList(['exetime'=> ['elt',time()]]);
|
|
|
+ $cron = $model_cron->getCronList(['exetime'=> ['elt',time()],'type' => ['in',$types]]);
|
|
|
if (!is_array($cron)) return ;
|
|
|
|
|
|
$cron_array = [];
|
|
@@ -288,6 +296,7 @@ class minutesControl extends BaseCronControl
|
|
|
$cron_array[$v['type']][$v['exeid']] = $v;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
foreach ($cron_array as $k=>$v)
|
|
|
{
|
|
|
// 如果方法不存是,直接删除id
|
|
@@ -298,7 +307,7 @@ class minutesControl extends BaseCronControl
|
|
|
}
|
|
|
|
|
|
$method = '_cron_'.$k;
|
|
|
- Log::record("crontab minutest err:{$method}",Log::DEBUG);
|
|
|
+ Log::record("crontab minutest:{$method}",Log::DEBUG);
|
|
|
|
|
|
$result = call_user_func_array([$this,'_cron_'.$k], [$v]);
|
|
|
if (is_array($result)){
|