Simpler update of blocking cache

merge-requests/30/head
Bob Mottram 2021-06-21 15:39:05 +01:00
parent 7d6b6d95fb
commit 7c9fc8dfbb
1 changed files with 5 additions and 2 deletions

View File

@ -186,9 +186,12 @@ def updateBlockedCache(baseDir: str,
return blockedCacheLastUpdated return blockedCacheLastUpdated
with open(globalBlockingFilename, 'r') as fpBlocked: with open(globalBlockingFilename, 'r') as fpBlocked:
blockedLines = fpBlocked.readlines() blockedLines = fpBlocked.readlines()
# remove newlines
for index in range(len(blockedLines)):
blockedLines[index] = blockedLines[index].replace('\n', '')
# update the cache
blockedCache.clear() blockedCache.clear()
for line in blockedLines: blockedCache += blockedLines
blockedCache.append(line.replace('\n', ''))
return currTime return currTime