|
@@ -4,6 +4,7 @@ namespace App\Console\Commands;
|
|
|
|
|
|
|
|
use App\Services\ThirdGameOrderService;
|
|
use App\Services\ThirdGameOrderService;
|
|
|
use Illuminate\Console\Command;
|
|
use Illuminate\Console\Command;
|
|
|
|
|
+use Illuminate\Support\Facades\Log;
|
|
|
|
|
|
|
|
class ThirdGameOrderSync extends Command
|
|
class ThirdGameOrderSync extends Command
|
|
|
{
|
|
{
|
|
@@ -20,12 +21,21 @@ class ThirdGameOrderSync extends Command
|
|
|
try {
|
|
try {
|
|
|
$result = $service->syncRealtime($page, 2000);
|
|
$result = $service->syncRealtime($page, 2000);
|
|
|
} catch (\Throwable $e) {
|
|
} catch (\Throwable $e) {
|
|
|
|
|
+ Log::error('third_game_sync_orders_failed', ['page' => $page, 'exception' => $e]);
|
|
|
$this->error($e->getMessage());
|
|
$this->error($e->getMessage());
|
|
|
return self::FAILURE;
|
|
return self::FAILURE;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (empty($result['ok'])) {
|
|
if (empty($result['ok'])) {
|
|
|
- $this->error((string) ($result['msg'] ?? '三方实时订单同步失败'));
|
|
|
|
|
|
|
+ $message = (string) ($result['msg'] ?? '三方实时订单同步失败');
|
|
|
|
|
+ // The provider allows one realtime query per minute and the admin list shares that quota. Each
|
|
|
|
|
+ // query covers the last 10 minutes, so a throttled run is skipped and the next run catches up.
|
|
|
|
|
+ if (!empty($result['throttled'])) {
|
|
|
|
|
+ $this->warn("page={$page} skipped: {$message}");
|
|
|
|
|
+ return self::SUCCESS;
|
|
|
|
|
+ }
|
|
|
|
|
+ Log::error('third_game_sync_orders_failed', ['page' => $page, 'message' => $message]);
|
|
|
|
|
+ $this->error($message);
|
|
|
return self::FAILURE;
|
|
return self::FAILURE;
|
|
|
}
|
|
}
|
|
|
|
|
|