Skip to content

Commit

Permalink
Merge pull request #331 from arXiv/ARXIVCE-984-add-expires-for-gcp
Browse files Browse the repository at this point in the history
add debug logging to expires
  • Loading branch information
kyokukou authored Jul 11, 2024
2 parents 2e0aed1 + 6131604 commit d8f12b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions search/utils/expires.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
from datetime import datetime, timedelta
from wsgiref.handlers import format_date_time
import logging


logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
def gen_search_expires() -> str:
"""Generate expires in RFC 1123 format.
RFC 1123 format ex 'Wed, 21 Oct 2015 07:28:00 GMT'
Expand All @@ -10,4 +14,5 @@ def gen_search_expires() -> str:
now=datetime.now()
expire = now + timedelta(minutes=10)
expires = format_date_time(expire.timestamp())
logger.debug(f"now: {now} expire: {expire} expires: {expires}")
return expires

0 comments on commit d8f12b4

Please sign in to comment.