Skip to content

Commit

Permalink
doc adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
chandra-tacc committed Oct 31, 2023
1 parent ba36707 commit 262bedb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@
logger.setLevel(logging.DEBUG)

@app.before_request
def log_request_info():
def before_request_log():
app.logger.info(("{0} \"{1} {2}\"".format(request.remote_addr, request.method, request.url)))

@app.after_request
def access_log(response):
def after_request_log(response):
app.logger.info(("{0} \"{1} {2}\" {3}".format(request.remote_addr, request.method, request.url, response.status_code)))
return response

Expand Down
2 changes: 2 additions & 0 deletions src/data_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,12 @@ def get_api_subjects_json(tapis_token):
# Retry handler for requests
@retry(wait_exponential_multiplier=500, wait_exponential_max=5000, stop_max_attempt_number=3)
def make_request_with_retry(url, cookies):
'''Use exponential retry with requests.'''
return requests.get(url, cookies=cookies)

# Get Tapis token if authorized to access data files
def get_tapis_token(api_request):
'''Get tapis token using the session cookie. If the session is not authenticated, this will fail.'''
response = make_request_with_retry(portal_api_root + '/auth/tapis/', api_request.cookies)
response.raise_for_status()
tapis_token = response.json()['token']
Expand Down

0 comments on commit 262bedb

Please sign in to comment.