【触客宝】 队列优化

This commit is contained in:
wong
2025-04-25 16:30:48 +08:00
parent dbc94e4823
commit 6904d0bfd3
5 changed files with 23 additions and 23 deletions

View File

@@ -82,9 +82,9 @@ class FriendTaskJob
$data = $response['data'];
// 判断是否有下一页
if (!empty($data) && count($data['results']) > 0) {
if (!empty($data) && count($data['results']) > 0 && $pageIndex < 2) {
// 更新缓存中的页码设置10分钟过期
Cache::set('friendTaskPage', $pageIndex + 1, 86400);
Cache::set('friendTaskPage', $pageIndex + 1, 600);
Log::info('更新缓存,下一页页码:' . ($pageIndex + 1) . '缓存时间10分钟');
// 有下一页,将下一页任务添加到队列
@@ -93,7 +93,7 @@ class FriendTaskJob
Log::info('添加下一页任务到队列,页码:' . $nextPageIndex);
} else {
// 没有下一页重置缓存设置10分钟过期
Cache::set('friendTaskPage', 0, 86400);
Cache::set('friendTaskPage', 0, 600);
Log::info('获取完成重置缓存缓存时间10分钟');
}