diff --git a/nextcloud-inotifyscan b/nextcloud-inotifyscan index 7215aff..920be33 100755 --- a/nextcloud-inotifyscan +++ b/nextcloud-inotifyscan @@ -29,18 +29,9 @@ while True: try: c = inotifywait_proc.stdout.read(1) except: - merged_paths = set() - for pp in scan_paths: - is_substring = False - for p in scan_paths: - if len(p) < len(pp): - if p == pp[:len(p)]: - is_substring = True - if not is_substring: - merged_paths |= {pp} - for p in merged_paths: + for p in scan_paths: sys.stderr.write('Scan for %s\n' % p) - subprocess.call(['php', nextcloud_home+'/occ', 'files:scan', '--no-interaction', '--path='+p]) + subprocess.call(['php', nextcloud_home+'/occ', 'files:scan', '--no-interaction', '--path='+p, '--shallow']) scan_paths = set() time.sleep(interval) continue