优化设备数据同步
parent
3f43e9953f
commit
4646f1fd16
|
|
@ -17,7 +17,7 @@ class DeviceLogSyncCommand extends Command
|
|||
*/
|
||||
protected $signature = 'device-log:sync
|
||||
{factory}
|
||||
{--sleep=60 : 设备数据同步完成后的休眠时间(秒)}';
|
||||
{--sleep=60 : 设备数据同步完成后的休眠时间(秒)}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
|
|
@ -38,7 +38,7 @@ class DeviceLogSyncCommand extends Command
|
|||
{
|
||||
$this->deviceLogService = $deviceLogService;
|
||||
|
||||
$sleep = value(fn ($sleep) => is_numeric($sleep) ? (int) $sleep : 60, $this->option('sleep'));
|
||||
$sleep = (int) value(fn ($sleep) => is_numeric($sleep) ? $sleep : 60, $this->option('sleep'));
|
||||
|
||||
while (true) {
|
||||
$end = now();
|
||||
|
|
|
|||
Loading…
Reference in New Issue