def retrieveAlertStats():
""" Retrieve combined statistics
AlertsLastMinute, AlertsLastHour, AlertsLast24Hours
"""
# get result from cache
getCacheResult = getCache(request.url, "url")
if getCacheResult is not False:
return jsonify(getCacheResult)
# query ES
else:
returnResult = formatAlertStats(queryAlertStats(checkCommunityIndex(request)))
setCache(request.url, returnResult, 13, "url")
app.logger.debug('UNCACHED %s' % str(request.url))
return jsonify(returnResult)
评论列表
文章目录