|
|
|
|
@ -43,9 +43,15 @@ async def get_test():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.get("/download/")
|
|
|
|
|
async def download_grib(background_tasks: BackgroundTasks):
|
|
|
|
|
"""Download and process GRIB files into csv of requested parameters"""
|
|
|
|
|
background_tasks.add_task(service_grib.extract_useful_data)
|
|
|
|
|
async def download_grib(
|
|
|
|
|
background_tasks: BackgroundTasks,
|
|
|
|
|
target_time: str = None,
|
|
|
|
|
):
|
|
|
|
|
"""Download and process GRIB files into csv of requested parameters
|
|
|
|
|
|
|
|
|
|
:param target_time: well formed ISO 8601 time string, we will try to download GRIB available just before it
|
|
|
|
|
"""
|
|
|
|
|
background_tasks.add_task(service_grib.extract_useful_data, target_time)
|
|
|
|
|
return JSONResponse(content={"status": "Background task started"})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|