mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Refactor the multiple "notify" systems into a single helper
structure. * Creates FileWatcher, in lqos_utils. * Removes "notify" dependency from other crates. FileWatcher is designed to watch a file. If the file doesn't exist, then an optional callback is called - and the watcher waits, periodically checking to see if the file has appeared yet. When the file appears, another optional callback is executed. Once the file exists, a `notify` system is started (it uses Linux's `inotify` system internally) for that file. When the file changes, the process sleeps briefly and then executes an `on_change` callback. Further messages are then suppressed for a short period to avoid duplicates. All uses of notify have been updated to use this system. Errors are handled cleanly, per ISSUE #209.
This commit is contained in:
6
src/rust/Cargo.lock
generated
6
src/rust/Cargo.lock
generated
@@ -1348,8 +1348,8 @@ dependencies = [
|
||||
"lazy_static",
|
||||
"lqos_bus",
|
||||
"lqos_config",
|
||||
"lqos_utils",
|
||||
"nix",
|
||||
"notify",
|
||||
"parking_lot 0.12.1",
|
||||
"rocket",
|
||||
"rocket_async_compression",
|
||||
@@ -1379,7 +1379,6 @@ dependencies = [
|
||||
"lqos_config",
|
||||
"lqos_sys",
|
||||
"lqos_utils",
|
||||
"notify",
|
||||
"parking_lot 0.12.1",
|
||||
"rayon",
|
||||
"serde",
|
||||
@@ -1412,7 +1411,9 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"log",
|
||||
"nix",
|
||||
"notify",
|
||||
"serde",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1430,7 +1431,6 @@ dependencies = [
|
||||
"lqos_sys",
|
||||
"lqos_utils",
|
||||
"nix",
|
||||
"notify",
|
||||
"parking_lot 0.12.1",
|
||||
"rayon",
|
||||
"serde",
|
||||
|
||||
Reference in New Issue
Block a user