mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Fix --force mechanism
This commit is contained in:
parent
12df96f33e
commit
cb6f53fc2b
1 changed files with 5 additions and 2 deletions
|
@ -88,7 +88,8 @@ class Diagnoser():
|
||||||
|
|
||||||
self.logger_debug, self.logger_warning, self.logger_info = loggers
|
self.logger_debug, self.logger_warning, self.logger_info = loggers
|
||||||
self.env = env
|
self.env = env
|
||||||
self.args = self.validate_args(args)
|
self.args = args
|
||||||
|
self.args.update(self.validate_args(args))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def cache_file(self):
|
def cache_file(self):
|
||||||
|
@ -110,10 +111,12 @@ class Diagnoser():
|
||||||
|
|
||||||
def report(self):
|
def report(self):
|
||||||
|
|
||||||
if self.args.get("force", False) or self.cached_time_ago() < self.cache_duration:
|
if not self.args.get("force", False) and self.cached_time_ago() < self.cache_duration:
|
||||||
self.logger_debug("Using cached report from %s" % self.cache_file)
|
self.logger_debug("Using cached report from %s" % self.cache_file)
|
||||||
return self.get_cached_report()
|
return self.get_cached_report()
|
||||||
|
|
||||||
|
self.logger_debug("Running diagnostic for %s" % self.id_)
|
||||||
|
|
||||||
new_report = { "id": self.id_,
|
new_report = { "id": self.id_,
|
||||||
"cached_for": self.cache_duration,
|
"cached_for": self.cache_duration,
|
||||||
"reports": list(self.run())
|
"reports": list(self.run())
|
||||||
|
|
Loading…
Add table
Reference in a new issue