pull/9/head
prplV 2024-07-12 16:11:25 +03:00
parent b62eb8caf6
commit b60e1c5b2f
1 changed files with 12 additions and 11 deletions

View File

@ -3,12 +3,12 @@ use serde_json;
use tokio::join; use tokio::join;
use core::panic; use core::panic;
use std::fmt::Debug; use std::fmt::Debug;
use std::{clone, fs}; use std::fs;
use std::path::Path; use std::path::Path;
use std::process::{ Command, Output }; use std::process::{ Command, Output };
use std::sync::{Arc, Mutex}; use std::sync::{ Arc, Mutex };
use tokio::time::{ Duration, Instant }; use tokio::time::{ Duration, Instant };
use tokio::sync::{mpsc, watch}; use tokio::sync::mpsc;
use inotify::{ Inotify, WatchMask }; use inotify::{ Inotify, WatchMask };
/// # an Error enum (nextly will be deleted and replaced) /// # an Error enum (nextly will be deleted and replaced)
@ -388,14 +388,15 @@ async fn file_handler
let events = notify.read_events(&mut buffer); let events = notify.read_events(&mut buffer);
match events { match events {
Ok(_) => { Ok(_) => {
match file.triggers.on_change.as_str() { println!("file {} changed!", &file.filename)
"stop" => { // match file.triggers.on_change.as_str() {
// tx.send(7).await.unwrap(); // "stop" => {
}, // tx.send(7).await.unwrap();
"restart" => {}, // },
"hold" => {}, // "restart" => {},
_ => {}, // "hold" => {},
} // _ => {},
// }
}, },
Err(_) => { Err(_) => {