FU: Simplify --monitor file change detection
This changes the way that file changes are detected. The upside is that it now correctly detects changes that happened after the code has loaded but before the first request came in, the downside is that it now gets stuck on reloading when a file has a future mtime.
This commit is contained in:
parent
fd8332601b
commit
f8cd8a6d8c
1 changed files with 1 additions and 6 deletions
7
FU.pm
7
FU.pm
|
|
@ -217,17 +217,12 @@ sub monitor_path { push @monitor_paths, @_ }
|
|||
sub monitor_check :prototype(&) { $monitor_check = $_[0] }
|
||||
|
||||
sub _monitor {
|
||||
state %data;
|
||||
return 1 if $monitor_check && $monitor_check->();
|
||||
|
||||
require File::Find;
|
||||
eval {
|
||||
File::Find::find({
|
||||
wanted => sub {
|
||||
my $m = (stat)[9];
|
||||
$data{$_} //= $m;
|
||||
die if $m > $data{$_};
|
||||
},
|
||||
wanted => sub { die if (-M) < 0 },
|
||||
no_chdir => 1
|
||||
}, grep -e, $scriptpath, values %INC, @monitor_paths);
|
||||
0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue