Implemented caching for API calls
Introduced new decorators: * response - responsible for parameters processing * cached - get/set to cache Removed all search functionality in API methods. Fixed logging. implements bp cache-api-methods Change-Id: I91d36424a36442a09591c140e9f22401139b7415
This commit is contained in:
@@ -42,7 +42,7 @@ def date_to_timestamp(d):
|
||||
def date_to_timestamp_ext(d):
|
||||
try:
|
||||
return date_to_timestamp(d)
|
||||
except ValueError:
|
||||
except (ValueError, TypeError):
|
||||
return int(d)
|
||||
|
||||
|
||||
@@ -72,6 +72,10 @@ def timestamp_to_day(timestamp):
|
||||
return timestamp // (24 * 3600)
|
||||
|
||||
|
||||
def round_timestamp_to_day(timestamp):
|
||||
return (int(timestamp) // (24 * 3600)) * (24 * 3600)
|
||||
|
||||
|
||||
def check_email_validity(email):
|
||||
if email:
|
||||
return re.match(r'[\w\d_\.-]+@([\w\d_\.-]+\.)+[\w]+', email)
|
||||
|
||||
Reference in New Issue
Block a user