diff --git a/apiserver/apiserver/api/utils_stats.py b/apiserver/apiserver/api/utils_stats.py index 3adf999..021a722 100644 --- a/apiserver/apiserver/api/utils_stats.py +++ b/apiserver/apiserver/api/utils_stats.py @@ -28,6 +28,7 @@ DEFAULTS = { 'sign': '', 'link': '', 'autoscan': '', + 'last_scan': {}, } if secrets.MUMBLE: diff --git a/apiserver/apiserver/api/views.py b/apiserver/apiserver/api/views.py index f7b92e0..714f30a 100644 --- a/apiserver/apiserver/api/views.py +++ b/apiserver/apiserver/api/views.py @@ -629,6 +629,12 @@ class DoorViewSet(viewsets.ViewSet, List): t = utils.now_alberta_tz().strftime('%Y-%m-%d %H:%M:%S, %a %I:%M %p') logger.info('Scan - Time: {} | Name: {} {} ({})'.format(t, member.preferred_name, member.last_name, member.id)) + last_scan = dict( + time=time.time(), + member_id=member.id, + ) + cache.set('last_scan', last_scan) + utils_stats.calc_card_scans() return Response(200)