summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/main.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.py b/src/main.py
index ad8aada..f95a09c 100755
--- a/src/main.py
+++ b/src/main.py
@@ -11,6 +11,7 @@ from pydantic import BaseModel
from index import CouchIindex
import time
from db import DictDB
+import requests
app = FastAPI()
@@ -35,9 +36,9 @@ async def mock_x_total_count_header(request: Request, call_next):
for i in range(10):
try:
db = DictDB()
- except Exception:
- print(
- f'Database not responding, will try again soon. Attempt {i + 1} of 10.')
+ except requests.exceptions.ConnectionError:
+ print(f'Database not responding, will try again soon.' +
+ 'Attempt {i + 1} of 10.')
else:
break
time.sleep(10)