scheduled($key)) { $this->warn($key . ':未启用后台同步,已跳过。'); continue; } try { // 四个已接入的小数据集顺序校准,每批沿用现有大小,直到完整结束。 $result = $synchronizer->sync($key, true, null, 0); if ($result['status'] !== 'succeeded') { $failed = true; $this->error($key . ':同步未完成,请检查同步状态。'); continue; } $this->info(sprintf('%s:同步完成,本轮 %d 批,累计处理 %d 行。', $key, $result['batches'], $result['rows'])); } catch (Throwable $exception) { $failed = true; Log::error('供应商管理每日镜像同步失败。', ['dataset' => $key, 'exception' => $exception::class]); $this->error($key . ':同步失败,请检查同步状态。'); } } return $failed ? self::FAILURE : self::SUCCESS; } }