Fix backup generation on relative paths (like when run outside docker, under venv, etc)

This commit is contained in:
dgtlmoon
2021-04-09 04:49:50 +02:00
parent 2ea48cb90a
commit 661542b056
2 changed files with 18 additions and 12 deletions

View File

@@ -3,6 +3,7 @@
# Launch as a eventlet.wsgi server instance.
import getopt
import os
import sys
import eventlet
@@ -15,7 +16,9 @@ from backend import store
def main(argv):
ssl_mode = False
port = 5000
datastore_path = "./datastore"
# Must be absolute so that send_from_directory doesnt try to make it relative to backend/
datastore_path = os.path.join(os.getcwd(), "datastore")
try:
opts, args = getopt.getopt(argv, "sd:p:", "purge")
@@ -38,8 +41,6 @@ def main(argv):
if opt == '-d':
datastore_path = arg
# threads can read from disk every x seconds right?
# front end can just save
# We just need to know which threads are looking at which UUIDs