feat: add kuaidi100 logistics sync
This commit is contained in:
26
server-api/app/process/Kuaidi100LogisticsSyncProcess.php
Normal file
26
server-api/app/process/Kuaidi100LogisticsSyncProcess.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace app\process;
|
||||
|
||||
use app\support\OrderLogisticsSyncService;
|
||||
use support\Log;
|
||||
use Workerman\Timer;
|
||||
|
||||
class Kuaidi100LogisticsSyncProcess
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
Timer::add(600, [$this, 'syncDue'], [], true);
|
||||
}
|
||||
|
||||
public function syncDue(): void
|
||||
{
|
||||
try {
|
||||
(new OrderLogisticsSyncService())->syncDue(50);
|
||||
} catch (\Throwable $e) {
|
||||
Log::warning('kuaidi100 logistics sync process failed', [
|
||||
'message' => $e->getMessage(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user