From a56de2ad5a0d33f28bbe49836abeaadf4f6d368d Mon Sep 17 00:00:00 2001 From: fly Date: Sat, 27 Mar 2021 18:50:44 +0000 Subject: [PATCH] Fix errors on interruptions Signed-off-by: fly --- worldbuild-worker.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/worldbuild-worker.py b/worldbuild-worker.py index 760cb53..8d2e101 100755 --- a/worldbuild-worker.py +++ b/worldbuild-worker.py @@ -91,12 +91,15 @@ if api != None and api_token == None: sys.exit(1) def cleanup(): - if os.path.isfile("projects/worldbuild-" + name + "/osm2city-exceptions.log"): - run("mv projects/worldbuild-" + name + "/osm2city-exceptions.log projects/worldbuild/output/error/" + name + "-" + strftime("%Y%m%d-%H%M") + ".exceptions.log", shell=True) + if name != None: + if os.path.isfile("projects/worldbuild-" + name + "/osm2city-exceptions.log"): + run("mv projects/worldbuild-" + name + "/osm2city-exceptions.log projects/worldbuild/output/error/" + name + "-" + strftime("%Y%m%d-%H%M") + ".exceptions.log", shell=True) - run("rm -rf projects/worldbuild-" + name, shell=True) + run("rm -rf projects/worldbuild-" + name, shell=True) + name = None build = None +name = None try: running = True while running: