Proper handling for ignore_directories in file.monitor backend

This commit is contained in:
Fabio Manganiello 2021-12-19 02:28:49 +01:00
parent 081da3eb84
commit e94d338de5
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -33,10 +33,10 @@ class FileMonitorBackend(Backend):
if isinstance(resource, str): if isinstance(resource, str):
resource = MonitoredResource(resource) resource = MonitoredResource(resource)
elif isinstance(resource, dict): elif isinstance(resource, dict):
if 'patterns' in resource or 'ignore_patterns' in resource: if 'regexes' in resource or 'ignore_regexes' in resource:
resource = MonitoredPattern(**resource)
elif 'regexes' in resource or 'ignore_regexes' in resource:
resource = MonitoredRegex(**resource) resource = MonitoredRegex(**resource)
elif 'patterns' in resource or 'ignore_patterns' in resource or 'ignore_directories' in resource:
resource = MonitoredPattern(**resource)
else: else:
resource = MonitoredResource(**resource) resource = MonitoredResource(**resource)