Add last scanned ID to stats
This commit is contained in:
parent
43a9595dd3
commit
b8a0effbb2
|
@ -28,6 +28,7 @@ DEFAULTS = {
|
||||||
'sign': '',
|
'sign': '',
|
||||||
'link': '',
|
'link': '',
|
||||||
'autoscan': '',
|
'autoscan': '',
|
||||||
|
'last_scan': {},
|
||||||
}
|
}
|
||||||
|
|
||||||
if secrets.MUMBLE:
|
if secrets.MUMBLE:
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user