Skip to content

Commit

Permalink
feat: support shallow scan
Browse files Browse the repository at this point in the history
  • Loading branch information
Blaok committed Oct 2, 2018
1 parent 671b863 commit e82b652
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions nextcloud-inotifyscan
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e82b652

Please sign in to comment.