File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -80,10 +80,19 @@ async fn main() -> anyhow::Result<()> {
80
80
. into_make_service ( ) ;
81
81
82
82
let inotify = {
83
- let meta = args. meta . clone ( ) ;
83
+ let meta = std:: path:: absolute ( & args. meta ) ?;
84
+ let meta_parent = match meta. parent ( ) {
85
+ Some ( parent) => parent. to_path_buf ( ) ,
86
+ None => anyhow:: bail!(
87
+ "Failed to watch for meta file changes. Parent folder could not be deteminated."
88
+ ) ,
89
+ } ;
90
+
84
91
tokio:: spawn ( async move {
85
92
let inotify = Inotify :: init ( ) ?;
86
- inotify. watches ( ) . add ( meta, WatchMask :: CLOSE_WRITE | WatchMask :: MOVED_TO ) ?;
93
+ inotify
94
+ . watches ( )
95
+ . add ( meta_parent, WatchMask :: CLOSE_WRITE | WatchMask :: MOVED_TO ) ?;
87
96
let mut buf = [ 0 ; 1024 ] ;
88
97
let mut stream = inotify. into_event_stream ( & mut buf) ?;
89
98
You can’t perform that action at this time.
0 commit comments