From abc10e93d714bd44a8693be357b76ae1fda06537 Mon Sep 17 00:00:00 2001 From: Ernst Widerberg Date: Fri, 14 Jan 2022 12:11:50 +0100 Subject: Decrease database reconnection timer --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main.py') diff --git a/src/main.py b/src/main.py index c3e5ad9..1340ba6 100755 --- a/src/main.py +++ b/src/main.py @@ -40,7 +40,7 @@ for i in range(10): f'Database not responding, will try again soon. Attempt {i + 1} of 10.') else: break - time.sleep(10) + time.sleep(1) else: print('Database did not respond after 10 attempts, quitting.') sys.exit(-1) -- cgit v1.1 From f5001fc965eae9748e089f36a6017674ca3be839 Mon Sep 17 00:00:00 2001 From: Ernst Widerberg Date: Fri, 14 Jan 2022 16:37:20 +0100 Subject: Bugfix --- src/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.py') diff --git a/src/main.py b/src/main.py index 1340ba6..fb359df 100755 --- a/src/main.py +++ b/src/main.py @@ -152,7 +152,7 @@ async def get_key(key=None, Authorize: AuthJWT = Depends()): data = get_data(key) - if data["domain"] not in allowed_domains: + if data and data["domain"] not in allowed_domains: return JSONResponse( content={ "status": "error", @@ -198,7 +198,7 @@ async def delete(key, Authorize: AuthJWT = Depends()): data = get_data(key) - if data["domain"] not in allowed_domains: + if data and data["domain"] not in allowed_domains: return JSONResponse( content={ "status": "error", -- cgit v1.1