Use os.listdir() and avoid os.walk() in launcher too

With millions of files, everything stalls otherwise.
pull/319/head
Federico Leva 6 years ago
parent 4351e09d80
commit 69ec7e5015

@ -45,12 +45,10 @@ def main():
#check if compressed, in that case dump was finished previously #check if compressed, in that case dump was finished previously
compressed = False compressed = False
for dirname, dirnames, filenames in os.walk('.'): for f in os.listdir('/mnt/raccolto/wikia'):
if dirname == '.': if f.startswith(prefix) and f.endswith('.7z'):
for f in filenames: compressed = True
if f.startswith(prefix) and f.endswith('.7z'): zipfilename = f
compressed = True
zipfilename = f
break #stop searching, dot not explore subdirectories break #stop searching, dot not explore subdirectories
if compressed: if compressed:

Loading…
Cancel
Save