Skip to content

Commit dc4769a

Browse files
committed
fix(logs): retry fetching logs from the logger 3 times if the services is unavailable
Fixes #676
1 parent 3ae2c17 commit dc4769a

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

rootfs/api/models/app.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import backoff
12
from collections import OrderedDict
23
from datetime import datetime
34
import logging
@@ -541,6 +542,7 @@ def verify_application_health(self, **kwargs):
541542
level=logging.DEBUG
542543
)
543544

545+
@backoff.on_exception(backoff.expo, ServiceUnavailable, max_tries=3)
544546
def logs(self, log_lines=str(settings.LOG_LINES)):
545547
"""Return aggregated log data for this application."""
546548
try:

rootfs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Deis controller requirements
2+
backoff==1.2.1
23
Django==1.9.7
34
django-cors-headers==1.1.0
45
django-guardian==1.4.4

0 commit comments

Comments
 (0)