hacky fix for #61

This commit is contained in:
xss 2023-06-13 16:24:39 +10:00
parent 4e827afe19
commit f3e30ffcef
2 changed files with 13 additions and 10 deletions

View File

@ -345,7 +345,7 @@ def stats(event, context):
"order": {
"recovered_by": "desc"
},
"size": 5
"size": 6
},
"aggs": {
"recovered_by": {
@ -393,6 +393,8 @@ def stats(event, context):
try:
output['top_chasers'] = { x['key'] : x['recovered_by']['value'] for x in results['aggregations']['top_recovered']['buckets']}
if "" in output['top_chasers']:
del output['top_chasers'][""]
except:
pass

View File

@ -46,16 +46,17 @@ payload = {
"timeEpoch": 1612051825409,
},
"body": json.dumps({
"datetime": "2021-06-06T01:10:07.629Z",
"serial": "S4631407",
"lat": 0,
"lon": 0,
"alt": 0,
"recovered": True,
"recovered_by": "string",
"description": "string"
# "datetime": "2021-06-06T01:10:07.629Z",
# "serial": "S4631407",
# "lat": 0,
# "lon": 0,
# "alt": 0,
# "recovered": True,
# "recovered_by": "string",
# "description": "string"
}),
"isBase64Encoded": False,
}
# print(put(payload, {}))
print(get(payload, {}))
#print(get(payload, {}))
print(stats(payload, {}))