正在显示
1 个修改的文件
包含
3 行增加
和
5 行删除
| @@ -61,7 +61,7 @@ class SyncFile extends Command | @@ -61,7 +61,7 @@ class SyncFile extends Command | ||
| 61 | $task_id = Redis::rpop($key); | 61 | $task_id = Redis::rpop($key); |
| 62 | if(empty($task_id)){ | 62 | if(empty($task_id)){ |
| 63 | $lock_key = 'sync_file_lock'; | 63 | $lock_key = 'sync_file_lock'; |
| 64 | - $lock_ttl = 100; | 64 | + $lock_ttl = 60; |
| 65 | // 尝试获取锁 | 65 | // 尝试获取锁 |
| 66 | $lock = Redis::set($lock_key, 1, 'EX', $lock_ttl, 'NX'); | 66 | $lock = Redis::set($lock_key, 1, 'EX', $lock_ttl, 'NX'); |
| 67 | if (empty($lock)){ | 67 | if (empty($lock)){ |
| @@ -71,10 +71,8 @@ class SyncFile extends Command | @@ -71,10 +71,8 @@ class SyncFile extends Command | ||
| 71 | $errorFileModel = new ErrorFile(); | 71 | $errorFileModel = new ErrorFile(); |
| 72 | $lists = $errorFileModel->list(['status'=>0],'id',['id','path'],'asc',2000); | 72 | $lists = $errorFileModel->list(['status'=>0],'id',['id','path'],'asc',2000); |
| 73 | foreach ($lists as $v){ | 73 | foreach ($lists as $v){ |
| 74 | - if (!$this->isTaskInQueue($key, $v['id'])) { | ||
| 75 | - Redis::lpush($key, $v['id']); | ||
| 76 | - $errorFileModel->edit(['status'=>1],['id'=>$v['id']]); | ||
| 77 | - } | 74 | + Redis::lpush($key, $v['id']); |
| 75 | + $errorFileModel->edit(['status'=>1],['id'=>$v['id']]); | ||
| 78 | } | 76 | } |
| 79 | $task_id = Redis::rpop($key); | 77 | $task_id = Redis::rpop($key); |
| 80 | } finally { | 78 | } finally { |
-
请 注册 或 登录 后发表评论