Skip to content

Commit

Permalink
修复热更新检测延时不生效的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurunsoft committed Aug 18, 2021
1 parent 19ea157 commit a450a64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/HotUpdate/HotUpdateProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function run(Worker $worker): void
// 检测间隔延时
if ($this->timespan > 0)
{
$time = (int) ($this->timespan - (microtime(true) - $time));
$time = $this->timespan - (microtime(true) - $time);
if ($time <= 0)
{
$time = 10000;
Expand All @@ -119,7 +119,7 @@ public function run(Worker $worker): void
{
$time = 10000;
}
usleep($time);
usleep((int) $time);
$time = microtime(true);
// 检查文件是否有修改
if ($monitor->isChanged())
Expand Down

0 comments on commit a450a64

Please sign in to comment.