异步更新数据

This commit is contained in:
2025-12-30 23:49:48 +08:00
parent f5187c013e
commit bb68bdd25b
2 changed files with 38 additions and 26 deletions

View File

@@ -8,6 +8,7 @@ use think\Db;
use think\Log;
use app\common\model\GiveGiftBase;
use think\cache\driver\Redis;
use app\api\model\GiveGift;
class GiftQueue
{
@@ -92,6 +93,7 @@ class GiftQueue
$failed = 0;
$model = new GiveGiftBase();
$gift_model = new GiveGift();
Log::info("开始处理送礼队列,批量大小: {$batchSize}");
@@ -129,6 +131,7 @@ class GiftQueue
if ($result) {
$success++;
$gift_model->change_user_give_gift_log_callback($result, $giftData);
Log::info("送礼记录处理成功: {$uuid}, ID: {$result}");
} else {
$failed++;