mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 17:57:19 +02:00
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:
parent
3ad7c46c77
commit
dc2ee91b7e
4 changed files with 58 additions and 4 deletions
|
@ -37,6 +37,7 @@ pub struct Config {
|
|||
pub enabled: bool,
|
||||
pub color: HashMap<String, Style>,
|
||||
pub filter: String,
|
||||
pub data_location: String,
|
||||
pub obfuscate: bool,
|
||||
pub print_empty_columns: bool,
|
||||
pub due: usize,
|
||||
|
@ -62,6 +63,7 @@ impl Config {
|
|||
print_empty_columns: bool_collection.get("print_empty_columns").cloned().unwrap_or(false),
|
||||
color: Self::get_color_collection()?,
|
||||
filter: Self::get_filter(),
|
||||
data_location: Self::get_data_location(),
|
||||
due: Self::get_due(),
|
||||
rule_precedence_color: Self::get_rule_precedence_color(),
|
||||
uda_task_report_show_info: Self::get_uda_task_report_show_info(),
|
||||
|
@ -296,6 +298,10 @@ impl Config {
|
|||
Self::get_config("report.next.filter")
|
||||
}
|
||||
|
||||
fn get_data_location() -> String {
|
||||
Self::get_config("data.location")
|
||||
}
|
||||
|
||||
fn get_uda_task_report_show_info() -> bool {
|
||||
Self::get_config("uda.taskwarrior-tui.task-report.show-info")
|
||||
.get_bool()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue