| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace App\Console\Commands;
- use App\Services\LogService;
- use App\Services\OrderPackageReceivedSyncService;
- use Illuminate\Console\Command;
- use Illuminate\Support\Facades\Log;
- class SyncOrderPackageLogisticRouteTask extends Command
- {
- /**
- * @var OrderPackageReceivedSyncService $service
- */
- public $service;
- /**
- * The name and signature of the console command.
- *
- * @var string
- */
- protected $signature = 'syncOrderPackageLogisticRouteTask';
- /**
- * The console command description.
- *
- * @var string
- */
- protected $description = 'Command description';
- /**
- * Create a new command instance.
- *
- * @return void
- */
- public function __construct()
- {
- parent::__construct();
- }
- /**
- * Execute the console command.
- *
- * @throws \Exception
- */
- public function handle()
- {
- $usage = memory_get_usage();
- $exeTime = microtime(true);
- ini_set('memory_limit', '2226M');
- $this->service = app('OrderPackageReceivedSyncService');
- $this->service->syncLogisticRoute();
- $this->service->syncLogisticRouteByAliJiSu();
- Log::warning("快递路由同步任务",["usage"=>(memory_get_usage()-$usage)/1048576,
- "elapsedTime"=>round(microtime(true)-$exeTime,3)]);//MB SECOND
- }
- }
|