Commit 39da806f authored by hujun's avatar hujun

定时异常处理

parent 9637d40a
...@@ -7,6 +7,7 @@ namespace app\task\controller; ...@@ -7,6 +7,7 @@ namespace app\task\controller;
use app\api_broker\service\SquareSortService; use app\api_broker\service\SquareSortService;
use app\model\BSquare; use app\model\BSquare;
use app\model\BSquareSort; use app\model\BSquareSort;
use think\Log;
class SquareTask class SquareTask
{ {
...@@ -18,6 +19,12 @@ class SquareTask ...@@ -18,6 +19,12 @@ class SquareTask
$this->m_square = new BSquare(); $this->m_square = new BSquare();
} }
/**
* 备份redis开盘排序
*
* User HuJun
* Date 19-5-8 上午10:09
*/
public function squareBackUp() { public function squareBackUp() {
$save_data = $square_id = []; $save_data = $square_id = [];
...@@ -42,6 +49,7 @@ class SquareTask ...@@ -42,6 +49,7 @@ class SquareTask
$square_id = array_unique($square_id); $square_id = array_unique($square_id);
sort($square_id); sort($square_id);
try {
foreach ($square_id as $k=>$v) { foreach ($square_id as $k=>$v) {
if (isset($look_num[$v])) { if (isset($look_num[$v])) {
$save_data['browse_number'] = $look_num[$v]; $save_data['browse_number'] = $look_num[$v];
...@@ -66,5 +74,10 @@ class SquareTask ...@@ -66,5 +74,10 @@ class SquareTask
$this->m_sort->insertData($save_data); $this->m_sort->insertData($save_data);
} }
} }
} catch (\Exception $e) {
Log::write($e->getMessage(), 'redis_backUp_square_task'); //记录日志
}
return ;
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment