diff options
author | Neil Kistner <neil.kistner@gmail.com> | 2019-09-09 18:14:38 -0500 |
---|---|---|
committer | Matan Kushner <hello@matchai.me> | 2019-09-09 19:14:38 -0400 |
commit | 9f70ffb7a7d2eeef64c360c553e909d38e44adf0 (patch) | |
tree | 4dccf8a935e027dcf7bc77781eed1554a645d72a /src/modules/jobs.rs | |
parent | dc8409333e194624896c74c5e5cdb4f664f53f9d (diff) |
fix: Lazy load git repo and only run module if not disabled (#306)
A couple of optimizations are done in this PR. One, we now will check config ahead of time to see if a module is disabled before running any module code. Also, we won't try to discover a git repository unless the module requests access to it.
Diffstat (limited to 'src/modules/jobs.rs')
-rw-r--r-- | src/modules/jobs.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/jobs.rs b/src/modules/jobs.rs index bb8a2d7d4..8a667049e 100644 --- a/src/modules/jobs.rs +++ b/src/modules/jobs.rs @@ -4,7 +4,7 @@ use super::{Context, Module}; /// Creates a segment to show if there are any active jobs running pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> { - let mut module = context.new_module("jobs")?; + let mut module = context.new_module("jobs"); let threshold = module.config_value_i64("threshold").unwrap_or(1); |