Improve global option management

This commit is contained in:
nicolargo 2023-05-15 10:01:11 +02:00
parent 3b997bcabb
commit f496a1ce18
1 changed files with 3 additions and 0 deletions

View File

@ -556,6 +556,9 @@ Examples of use:
# Plugins refresh rate
if self.config.has_section('global'):
global_refresh = self.config.get_float_value('global', 'refresh', default=self.DEFAULT_REFRESH_TIME)
else:
global_refresh = self.DEFAULT_REFRESH_TIME
# The configuration key can be overwrite from the command line
if args.time == self.DEFAULT_REFRESH_TIME:
args.time = global_refresh
logger.debug('Global refresh rate is set to {} seconds'.format(args.time))