fix mapdata updates fetch counter
This commit is contained in:
parent
e237b26464
commit
e58e26ba76
1 changed files with 6 additions and 5 deletions
|
@ -415,11 +415,6 @@ class UpdatesViewSet(GenericViewSet):
|
|||
"""
|
||||
@list_route(methods=['get'])
|
||||
def fetch(self, request, key=None):
|
||||
try:
|
||||
cache.incr('api_updates_fetch_requests')
|
||||
except ValueError:
|
||||
cache.set('api_updates_fetch_requests', 0, None)
|
||||
|
||||
cross_origin = request.META.get('HTTP_ORIGIN')
|
||||
if cross_origin is not None:
|
||||
try:
|
||||
|
@ -428,6 +423,12 @@ class UpdatesViewSet(GenericViewSet):
|
|||
except ValueError:
|
||||
pass
|
||||
|
||||
counter_key = 'api_updates_fetch_requests%s' % ('_cross_origin' if cross_origin is not None else '')
|
||||
try:
|
||||
cache.incr(counter_key)
|
||||
except ValueError:
|
||||
cache.set(counter_key, 0, None)
|
||||
|
||||
from c3nav.site.models import SiteUpdate
|
||||
|
||||
result = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue