Increase reliability of folder search timeout
This commit is contained in:
parent
b8f06efc33
commit
1af4d69fbd
@ -1699,6 +1699,7 @@ class FileSwitchManager(object):
|
|||||||
startTime = time.time()
|
startTime = time.time()
|
||||||
if os.path.isfile(os.path.join(directory, randomFilename)):
|
if os.path.isfile(os.path.join(directory, randomFilename)):
|
||||||
randomFilename = u"RandomFile"+unicode(random.randrange(10000, 99999))+u".txt"
|
randomFilename = u"RandomFile"+unicode(random.randrange(10000, 99999))+u".txt"
|
||||||
|
print "Found random file (?)"
|
||||||
if time.time() - startTime > constants.FOLDER_SEARCH_FIRST_FILE_TIMEOUT:
|
if time.time() - startTime > constants.FOLDER_SEARCH_FIRST_FILE_TIMEOUT:
|
||||||
self.folderSearchEnabled = False
|
self.folderSearchEnabled = False
|
||||||
self.directorySearchError = getMessage("folder-search-first-file-timeout-error").format(directory)
|
self.directorySearchError = getMessage("folder-search-first-file-timeout-error").format(directory)
|
||||||
@ -1744,9 +1745,12 @@ class FileSwitchManager(object):
|
|||||||
startTime = time.time()
|
startTime = time.time()
|
||||||
if os.path.isfile(os.path.join(directory, randomFilename)):
|
if os.path.isfile(os.path.join(directory, randomFilename)):
|
||||||
randomFilename = u"RandomFile"+unicode(random.randrange(10000, 99999))+u".txt"
|
randomFilename = u"RandomFile"+unicode(random.randrange(10000, 99999))+u".txt"
|
||||||
|
print "Found random file (?)"
|
||||||
if not self.folderSearchEnabled:
|
if not self.folderSearchEnabled:
|
||||||
return
|
return
|
||||||
if time.time() - startTime > constants.FOLDER_SEARCH_FIRST_FILE_TIMEOUT:
|
if time.time() - startTime > constants.FOLDER_SEARCH_FIRST_FILE_TIMEOUT:
|
||||||
|
self.folderSearchEnabled = False
|
||||||
|
self.directorySearchError = getMessage("folder-search-first-file-timeout-error").format(directory)
|
||||||
return
|
return
|
||||||
|
|
||||||
startTime = time.time()
|
startTime = time.time()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user