队列调整
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
namespace app\common;
|
||||
use think\Db;
|
||||
use think\Cache;
|
||||
class QueueJob
|
||||
{
|
||||
|
||||
@@ -44,5 +45,33 @@ class QueueJob
|
||||
$result = DB::name('wechat_queue_logs')->where('log_id',$iLogId)->limit(1)->update($aUpdate);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 写入Reids 防止1小时内重复操作
|
||||
*/
|
||||
|
||||
public function setRedisLabel($aParam = []){
|
||||
//判断数据是否为空
|
||||
if(empty($aParam['redis_key'])){
|
||||
return false;
|
||||
}
|
||||
//获取值
|
||||
$sValue = $this->getRedisLabel($aParam['redis_key']);
|
||||
if(!empty($sValue)){
|
||||
return false;
|
||||
}
|
||||
//写入
|
||||
return Cache::set($aParam['redis_key'], $aParam['redis_key'], 3600);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Reids值
|
||||
*/
|
||||
public function getRedisLabel($sRedisKey = ''){
|
||||
if(empty($sRedisKey)){
|
||||
return '';
|
||||
}
|
||||
return Cache::get($sRedisKey);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user