Auto-delete engines that are > 24hrs old
This commit is contained in:
1 parent
620cc49c81
commit
6f9f3f6175
1 file changed
+11
@@ -31,6 +31,7 @@ WORKLOAD_TIMEOUT = 60 # Timeout when there is no work
|
|||||||
ERROR_TIMEOUT = 60 # Timeout when an error is thrown
|
ERROR_TIMEOUT = 60 # Timeout when an error is thrown
|
||||||
GAMES_PER_CONCURRENCY = 32 # Total games to play per concurrency
|
GAMES_PER_CONCURRENCY = 32 # Total games to play per concurrency
|
||||||
SAVE_PGN_FILES = False # Auto-save PGN output for engine pairings
|
SAVE_PGN_FILES = False # Auto-save PGN output for engine pairings
|
||||||
|
AUTO_DELETE_ENGINES = True # Delete Engines that are over 24hrs old
|
||||||
|
|
||||||
CUSTOM_SETTINGS = {
|
CUSTOM_SETTINGS = {
|
||||||
'Ethereal' : { 'args' : [] }, # Configuration for Ethereal
|
'Ethereal' : { 'args' : [] }, # Configuration for Ethereal
|
||||||
@@ -80,6 +81,15 @@ def killCutechess(cutechess):
|
|||||||
except KeyboardInterrupt: sys.exit()
|
except KeyboardInterrupt: sys.exit()
|
||||||
except Exception as error: pass
|
except Exception as error: pass
|
||||||
|
|
||||||
|
def cleanupEnginesDirectory():
|
||||||
|
|
||||||
|
SECONDS_PER_DAY = 60 * 60 * 24;
|
||||||
|
|
||||||
|
for file in os.listdir('Engines/'):
|
||||||
|
if time.time() - os.path.getmtime('Engines/{0}'.format(file)) > SECONDS_PER_DAY:
|
||||||
|
os.remove('Engines/{0}'.format(file))
|
||||||
|
print ("[NOTE] Deleted old engine", file)
|
||||||
|
|
||||||
|
|
||||||
def getCutechess(server):
|
def getCutechess(server):
|
||||||
|
|
||||||
@@ -661,6 +671,7 @@ def main():
|
|||||||
|
|
||||||
# Continually pull down and complete workloads
|
# Continually pull down and complete workloads
|
||||||
while True:
|
while True:
|
||||||
|
if AUTO_DELETE_ENGINES: cleanupEnginesDirectory()
|
||||||
try: completeWorkload(workRequestData, arguments)
|
try: completeWorkload(workRequestData, arguments)
|
||||||
except KeyboardInterrupt: sys.exit()
|
except KeyboardInterrupt: sys.exit()
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
|
|||||||
Reference in new issue
Block a user