Skip to content

Commit adc49bc

Browse files
committed
Fix removing simulations
1 parent 2188d48 commit adc49bc

1 file changed

Lines changed: 0 additions & 13 deletions

File tree

opendrift_leeway_webgui/leeway/tasks.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import logging
22
import os
33
import subprocess
4-
from datetime import timedelta
54
from pathlib import Path
65

76
import requests as http_requests
@@ -133,15 +132,3 @@ def download_icon_weather_data():
133132
for frt in frts:
134133
download_and_merge(frt)
135134
logger.info("EU ICON weather data download completed.")
136-
137-
# Clean old simulations
138-
logger.info("Cleaning old simulation data.")
139-
for simulation in apps.get_model(app_label="leeway", model_name="LeewaySimulation").objects.filter(
140-
start_time__lt=timezone.now() - timedelta(days=settings.SIMULATION_RETENTION)
141-
):
142-
logger.info("Removed simulation %s.", simulation.uuid)
143-
if simulation.img:
144-
simulation.img.delete()
145-
if simulation.netcdf:
146-
simulation.netcdf.delete()
147-
simulation.delete()

0 commit comments

Comments
 (0)