Skip to content

Commit

Permalink
add debug logging to expires
Browse files Browse the repository at this point in the history
  • Loading branch information
kyokukou committed Jul 11, 2024
1 parent 5fc7dd3 commit 6131604
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 6131604

Please sign in to comment.