Add last scanned ID to stats

This commit is contained in:
Tanner Collin 2023-02-18 19:26:43 +00:00
parent 43a9595dd3
commit b8a0effbb2
2 changed files with 7 additions and 0 deletions

View File

@ -28,6 +28,7 @@ DEFAULTS = {
'sign': '', 'sign': '',
'link': '', 'link': '',
'autoscan': '', 'autoscan': '',
'last_scan': {},
} }
if secrets.MUMBLE: if secrets.MUMBLE:

View File

@ -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') 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)) 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() utils_stats.calc_card_scans()
return Response(200) return Response(200)