Improve CPU usage by invoking task less often

Only invoke task to export tasks data when pending.data taskwarrior file has changed.

This reduces CPU usage when idle from 50% to 2% on my system.
This commit is contained in:
desbma 2021-03-01 01:26:37 +01:00
parent 3ad7c46c77
commit dc2ee91b7e
4 changed files with 58 additions and 4 deletions

10
Cargo.lock generated
View file

@ -705,6 +705,15 @@ dependencies = [
"serde",
]
[[package]]
name = "shellexpand"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83bdb7831b2d85ddf4a7b148aa19d0587eddbe8671a436b7bd1182eaad0f2829"
dependencies = [
"dirs-next",
]
[[package]]
name = "shlex"
version = "0.1.1"
@ -813,6 +822,7 @@ dependencies = [
"rustyline",
"serde",
"serde_json",
"shellexpand",
"shlex",
"task-hookrs",
"tui",