Skip to content
Snippets Groups Projects
Commit b78bd80e authored by ThibautDemare's avatar ThibautDemare
Browse files

timedelta should be imported independently

parent 60bd6598
Branches
No related merge requests found
......@@ -2,6 +2,7 @@ from subprocess import run, Popen, PIPE
import multiprocessing
import time
from datetime import datetime
from datetime import timedelta
def nbContainers():
result=run("docker ps -aq | wc -l", shell=True, stdout=PIPE).stdout.decode('utf-8')
......@@ -14,8 +15,8 @@ def backup():
Popen("docker checkpoint create --leave-running=true --checkpoint-dir='$(pwd)/"+str(c)"/ContainerBackup/' " + c + " " + "checkpoint_" + c)
def checkForBackupNeedsAndWait():
# Should we backup the simulations ?
timeBetweenTwoBackup = datetime.timedelta(minutes=10) # We have one day between two backups
# Should we backup the simulations ?
timeBetweenTwoBackup = timedelta(minutes=2) # We have one day between two backups
now = datetime.now()
if now > (lastBackup + timeBetweenTwoBackup):
backup()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment