mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-11-29 18:27:44 +08:00
完善FindDriver热更新 (#2193)
* 完善FindDriver热更新 * Update CHANGELOG-2.0.md Co-authored-by: zhangzibin <zhangzibin@ecomxhat.com> Co-authored-by: 李铭昕 <715557344@qq.com>
This commit is contained in:
parent
c224ba6922
commit
862a0a824e
@ -1,5 +1,9 @@
|
||||
# v2.0.5 - TBD
|
||||
|
||||
## Optimized
|
||||
|
||||
- [#2193](https://github.com/hyperf/hyperf/pull/2193) Optimized the scan accuracy for `Hyperf\Watcher\Driver\FindDriver`.
|
||||
|
||||
# v2.0.4 - 2020-07-27
|
||||
|
||||
## Added
|
||||
|
@ -56,7 +56,7 @@ class FindDriver implements DriverInterface
|
||||
}
|
||||
|
||||
$seconds = ceil(($ms + 1000) / 1000);
|
||||
$minutes = sprintf('%.2f', $seconds / 60);
|
||||
$minutes = sprintf('-%.2f', $seconds / 60);
|
||||
|
||||
[$fileModifyTimes, $changedFiles] = $this->scan($fileModifyTimes, $minutes);
|
||||
|
||||
@ -70,6 +70,10 @@ class FindDriver implements DriverInterface
|
||||
{
|
||||
$changedFiles = [];
|
||||
$dest = implode(' ', $targets);
|
||||
/**
|
||||
* In linux system, you can use command below
|
||||
* find app -mmin -0.05 -type f -printf "%p %T+\n"
|
||||
*/
|
||||
$ret = System::exec($this->getBin() . ' ' . $dest . ' -mmin ' . $minutes . ' -type f -printf "%p %T+' . PHP_EOL . '"');
|
||||
if ($ret['code'] === 0 && strlen($ret['output'])) {
|
||||
$stdout = $ret['output'];
|
||||
|
Loading…
Reference in New Issue
Block a user