@@ -9,7 +9,7 @@ use tokio::{
99 time:: interval,
1010} ;
1111
12- use super :: { EndpointConfig , FactConfig , CONFIG_PATHS } ;
12+ use super :: { EndpointConfig , FactConfig , CONFIG_FILES } ;
1313
1414pub struct Reloader {
1515 config : FactConfig ,
@@ -73,34 +73,34 @@ impl Reloader {
7373 fn update_cache ( & mut self ) -> bool {
7474 let mut res = false ;
7575
76- for path in CONFIG_PATHS {
77- let p = PathBuf :: from ( path ) ;
78- if p . exists ( ) {
79- let mtime = match p . metadata ( ) {
76+ for file in CONFIG_FILES {
77+ let path = PathBuf :: from ( file ) ;
78+ if path . exists ( ) {
79+ let mtime = match path . metadata ( ) {
8080 Ok ( m) => m. mtime ( ) ,
8181 Err ( e) => {
82- warn ! ( "Failed to stat {path }: {e}" ) ;
82+ warn ! ( "Failed to stat {file }: {e}" ) ;
8383 warn ! ( "Configuration reloading may not work" ) ;
8484 continue ;
8585 }
8686 } ;
87- match self . files . get_mut ( & path ) {
87+ match self . files . get_mut ( & file ) {
8888 Some ( old) if * old == mtime => { }
8989 Some ( old) => {
90- debug ! ( "Updating '{path }'" ) ;
90+ debug ! ( "Updating '{file }'" ) ;
9191 res = true ;
9292 * old = mtime;
9393 }
9494 None => {
95- debug ! ( "New configuration file '{path }'" ) ;
95+ debug ! ( "New configuration file '{file }'" ) ;
9696 res = true ;
97- self . files . insert ( path , mtime) ;
97+ self . files . insert ( file , mtime) ;
9898 }
9999 }
100- } else if self . files . contains_key ( & path ) {
101- debug ! ( "'{path }' no longer exists, removing from cache" ) ;
100+ } else if self . files . contains_key ( & file ) {
101+ debug ! ( "'{file }' no longer exists, removing from cache" ) ;
102102 res = true ;
103- self . files . remove ( & path ) ;
103+ self . files . remove ( & file ) ;
104104 }
105105 }
106106 res
@@ -142,7 +142,7 @@ impl Reloader {
142142
143143impl From < FactConfig > for Reloader {
144144 fn from ( config : FactConfig ) -> Self {
145- let files = CONFIG_PATHS
145+ let files = CONFIG_FILES
146146 . iter ( )
147147 . filter_map ( |path| {
148148 let p = PathBuf :: from ( path) ;
0 commit comments