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: