option('full')) { return self::SUCCESS; } try { $result = $synchronizer->sync( (bool) $this->option('full'), $this->option('batch') === null ? null : (int) $this->option('batch'), $this->option('max-batches') === null ? null : (int) $this->option('max-batches'), ); } catch (Throwable $exception) { Log::error('商品价格共享镜像同步失败。', ['exception' => $exception::class]); $this->error('商品价格共享镜像同步失败,已保留上一版共享数据。'); return self::FAILURE; } if ($result['status'] === 'requires_full_sync') { $this->warn('商品价格共享镜像尚未执行首次全量同步。'); return self::SUCCESS; } $this->info(sprintf( '商品价格镜像:%s,本轮 %d 批,累计处理 %d 行。', $result['status'] === 'succeeded' ? '同步完成' : '同步进行中', $result['batches'], $result['rows'], )); return self::SUCCESS; } }