Log: 给流量消费队列当中保存失败的用户增加错误日志

This commit is contained in:
xboard 2023-12-06 19:11:29 +08:00
parent 1fcb6fa911
commit c25803aa74

View File

@ -66,13 +66,16 @@ class TrafficFetchJob implements ShouldQueue
$newTime = time();
$newU = $user->u + ($v[0] * $targetServer['rate']);
$newD = $user->d + ($v[1] * $targetServer['rate']);
\DB::table('v2_user')
$rows = \DB::table('v2_user')
->where('id', $uid)
->update([
't' => $newTime,
'u' => $newU,
'd' => $newD,
]);
if($rows === 0){
\Log::error("流量更新失败\n未记录用户ID:{$uid}\n未记录上行:{$user->u}\n未记录下行:{$user->d}");
}
}, 3);
}
}