Fixed more issues

Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
fly 2021-03-27 19:12:03 +00:00
parent a56de2ad5a
commit 59ef035bec

View file

@ -90,7 +90,7 @@ if api != None and api_token == None:
print("Error: API given but no token")
sys.exit(1)
def cleanup():
def cleanup(name):
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)
@ -149,7 +149,7 @@ try:
build.wait()
build = None
cleanup()
cleanup(name)
if api != None:
api_send_status(name, "done", api, api_token)
@ -162,7 +162,7 @@ except KeyboardInterrupt:
try:
if build != None:
build.wait()
cleanup()
cleanup(name)
if api != None:
api_send_status(name, "done", api, api_token)
else:
@ -174,5 +174,5 @@ except KeyboardInterrupt:
sleep(5)
build.kill()
sleep(5)
cleanup()
cleanup(name)
sys.exit(0)