diff --git a/src/job/sync_shipment.job.ts b/src/job/sync_shipment.job.ts index c532844..94707d9 100644 --- a/src/job/sync_shipment.job.ts +++ b/src/job/sync_shipment.job.ts @@ -75,10 +75,14 @@ export class SyncUniuniShipmentJob implements IJob{ '255': 'Gateway_To_Gateway_Transit' }; async onTick() { - const shipments:Shipment[] = await this.shipmentModel.findBy({ finished: false }); - shipments.forEach(shipment => { - this.logisticsService.updateShipmentState(shipment); - }); + try { + const shipments:Shipment[] = await this.shipmentModel.findBy({ finished: false }); + shipments.forEach(shipment => { + this.logisticsService.updateShipmentState(shipment); + }); + } catch (error) { + this.logger.error(`更新运单状态失败 ${error.message}`); + } } onComplete(result: any) {