Increment GRFS downloads metric
All checks were successful
Amarillo/amarillo-gitea/amarillo-grfs-export/pipeline/head This commit looks good
All checks were successful
Amarillo/amarillo-gitea/amarillo-grfs-export/pipeline/head This commit looks good
This commit is contained in:
parent
3ee4478cfc
commit
2c1190adb6
|
|
@ -42,6 +42,11 @@ def _assert_region_exists(region_id: str) -> Region:
|
||||||
)
|
)
|
||||||
async def get_file(region_id: str, user: str = Depends(verify_admin_api_key)):
|
async def get_file(region_id: str, user: str = Depends(verify_admin_api_key)):
|
||||||
_assert_region_exists(region_id)
|
_assert_region_exists(region_id)
|
||||||
|
try:
|
||||||
|
from amarillo.plugins.metrics import increment_grfs_download_counter
|
||||||
|
increment_grfs_download_counter()
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
return FileResponse(f'data/grfs/amarillo.{region_id}.gtfs.zip')
|
return FileResponse(f'data/grfs/amarillo.{region_id}.gtfs.zip')
|
||||||
|
|
||||||
@router.get("/region/{region_id}/grfs-rt/",
|
@router.get("/region/{region_id}/grfs-rt/",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue