Made procedure.[sync|async].name second argument optional

A procedure will be sync if [sync|async] is not specified
This commit is contained in:
Fabio Manganiello 2019-12-01 16:48:57 +01:00
parent f281411b2e
commit a18452ab2e

View file

@ -162,8 +162,8 @@ class Config(object):
self.cronjobs[cron_name] = self._config[key] self.cronjobs[cron_name] = self._config[key]
elif key.startswith('procedure.'): elif key.startswith('procedure.'):
tokens = key.split('.') tokens = key.split('.')
_async = True if tokens[1] == 'async' else False _async = True if len(tokens) > 2 and tokens[1] == 'async' else False
procedure_name = '.'.join(tokens[2:]) procedure_name = '.'.join(tokens[2:] if len(tokens) > 2 else tokens[1:])
self.procedures[procedure_name] = { self.procedures[procedure_name] = {
'_async': _async, '_async': _async,
'actions': self._config[key] 'actions': self._config[key]