From f8cd8a6d8cbc687e452071b98f1457f546a55c08 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Tue, 27 May 2025 09:30:46 +0200 Subject: [PATCH] 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. --- FU.pm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/FU.pm b/FU.pm index 9c85edf..6da28cb 100644 --- a/FU.pm +++ b/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