linted code
This commit is contained in:
@@ -254,7 +254,13 @@ async def all_ips(
|
|||||||
page_size = min(max(1, page_size), 10000)
|
page_size = min(max(1, page_size), 10000)
|
||||||
|
|
||||||
# Serve from cache on default map request (top 100 IPs)
|
# Serve from cache on default map request (top 100 IPs)
|
||||||
if page == 1 and page_size == 100 and sort_by == "total_requests" and sort_order == "desc" and is_warm():
|
if (
|
||||||
|
page == 1
|
||||||
|
and page_size == 100
|
||||||
|
and sort_by == "total_requests"
|
||||||
|
and sort_order == "desc"
|
||||||
|
and is_warm()
|
||||||
|
):
|
||||||
cached = get_cached("map_ips")
|
cached = get_cached("map_ips")
|
||||||
if cached:
|
if cached:
|
||||||
return JSONResponse(content=cached, headers=_no_cache_headers())
|
return JSONResponse(content=cached, headers=_no_cache_headers())
|
||||||
|
|||||||
@@ -60,7 +60,11 @@ async def htmx_top_ips(
|
|||||||
sort_order: str = Query("desc"),
|
sort_order: str = Query("desc"),
|
||||||
):
|
):
|
||||||
# Serve from cache on default first-page request
|
# Serve from cache on default first-page request
|
||||||
cached = get_cached("top_ips") if (page == 1 and sort_by == "count" and sort_order == "desc" and is_warm()) else None
|
cached = (
|
||||||
|
get_cached("top_ips")
|
||||||
|
if (page == 1 and sort_by == "count" and sort_order == "desc" and is_warm())
|
||||||
|
else None
|
||||||
|
)
|
||||||
if cached:
|
if cached:
|
||||||
result = cached
|
result = cached
|
||||||
else:
|
else:
|
||||||
@@ -93,7 +97,11 @@ async def htmx_top_paths(
|
|||||||
sort_by: str = Query("count"),
|
sort_by: str = Query("count"),
|
||||||
sort_order: str = Query("desc"),
|
sort_order: str = Query("desc"),
|
||||||
):
|
):
|
||||||
cached = get_cached("top_paths") if (page == 1 and sort_by == "count" and sort_order == "desc" and is_warm()) else None
|
cached = (
|
||||||
|
get_cached("top_paths")
|
||||||
|
if (page == 1 and sort_by == "count" and sort_order == "desc" and is_warm())
|
||||||
|
else None
|
||||||
|
)
|
||||||
if cached:
|
if cached:
|
||||||
result = cached
|
result = cached
|
||||||
else:
|
else:
|
||||||
@@ -126,7 +134,11 @@ async def htmx_top_ua(
|
|||||||
sort_by: str = Query("count"),
|
sort_by: str = Query("count"),
|
||||||
sort_order: str = Query("desc"),
|
sort_order: str = Query("desc"),
|
||||||
):
|
):
|
||||||
cached = get_cached("top_ua") if (page == 1 and sort_by == "count" and sort_order == "desc" and is_warm()) else None
|
cached = (
|
||||||
|
get_cached("top_ua")
|
||||||
|
if (page == 1 and sort_by == "count" and sort_order == "desc" and is_warm())
|
||||||
|
else None
|
||||||
|
)
|
||||||
if cached:
|
if cached:
|
||||||
result = cached
|
result = cached
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user