Skip to content

Commit 998a37c

Browse files
author
Dan Kelley
committed
updated timeout, added test and fixed dependency issue
1 parent de58dd1 commit 998a37c

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

src/client/default.conf.template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ server {
2222
proxy_set_header X-Real-IP $remote_addr;
2323
proxy_set_header Host $host;
2424
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
25+
proxy_read_timeout 3600;
26+
proxy_connect_timeout 3600;
27+
proxy_send_timeout 3600;
28+
send_timeout 3600;
2529
# Following is necessary for Websocket support
2630
# proxy_http_version 1.1;
2731
# proxy_set_header Upgrade $http_upgrade;

src/server/api/common_api.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,22 @@
44
from sqlalchemy.sql import text
55
import requests
66
import json
7+
import time
8+
from datetime import datetime
79
import dateutil.parser
810
from secrets import SHELTERLUV_SECRET_TOKEN
911

1012

13+
@common_api.route('/api/timeout_test/<duration>', methods=['GET'])
14+
def get_timeout(duration):
15+
start = datetime.now().strftime("%H:%M:%S");
16+
time.sleep(int(duration))
17+
18+
stop = datetime.now().strftime("%H:%M:%S");
19+
results = jsonify({'result': 'success', 'duration': duration, 'start': start, 'stop': stop})
20+
21+
return results
22+
1123
@common_api.route('/api/contacts/<search_text>', methods=['GET'])
1224
def get_contacts(search_text):
1325
with engine.connect() as connection:

src/server/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Flask==1.1.2
22
pandas==1.0.0
33
numpy==1.18.1
44
fuzzywuzzy==0.17.0
5-
sqlalchemy
5+
sqlalchemy < 1.4.0
66
sqlalchemy_utils
77
psycopg2-binary==2.8.4
88
python-Levenshtein-wheels

0 commit comments

Comments
 (0)