Skip to content

Commit 6a4b094

Browse files
author
Benjamin Davison
committed
Fixed cube export path
1 parent ee4cd20 commit 6a4b094

3 files changed

Lines changed: 20 additions & 5 deletions

File tree

client/src/views/MultiSourceCube.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,8 +1599,8 @@ const frequency = ref('monthly');
15991599
const selectedVariables = ref(['s_filt']);
16001600
16011601
// Cube limits
1602-
const MAX_AREA_SQKM = 10000; // sq km
1603-
const MAX_DAYS = 366;
1602+
const MAX_AREA_SQKM = 50000; // sq km
1603+
const MAX_DAYS = 3660;
16041604
16051605
const availableVariables = [
16061606
{ id: 's_filt', name: 'Speed (Time-filtered)' },

server/dependencies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
MAIL_FROM_NAME = os.getenv("MAIL_FROM_NAME")
2929

3030
# --- CUBE LIMITS PER DAY ---
31-
MAX_CUBES_PER_DAY = 50000
31+
MAX_CUBES_PER_DAY = 5
3232

3333
# --- REDIS CONFIGURATION ---
3434
REDIS_HOST = os.getenv("REDIS_HOST", "localhost")

server/main.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,26 @@ def _create_lut(cmap_func):
150150
app.include_router(analysis.router)
151151

152152
# --- CONFIG: STATIC FILES ---
153-
# Mounts the 'static' folder to serve GeoJSON/CSS/JS files
153+
current_os = platform.system()
154+
is_wsl = "WSL_DISTRO_NAME" in os.environ
155+
156+
if current_os == "Windows" or is_wsl:
157+
export_dir = current_dir / "static" / "exports"
158+
else:
159+
export_dir = Path("/mnt/grio1/Shared/SHIVER/data/exports")
160+
161+
# Ensure the export directory exists
162+
export_dir.mkdir(parents=True, exist_ok=True)
163+
164+
# 2. Mount the highly specific exports path FIRST
165+
app.mount("/static/exports", StaticFiles(directory=export_dir), name="exports")
166+
167+
# 3. Mount the general static folder SECOND
154168
static_path = current_dir / "static"
155-
static_path.mkdir(exist_ok=True) # Creates it if it doesn't exist
169+
static_path.mkdir(exist_ok=True)
156170
app.mount("/static", StaticFiles(directory=static_path), name="static")
157171

172+
158173
# --- DATA MODELS (Pydantic) ---
159174
class RoiRequest(BaseModel):
160175
roi: List[List[float]]

0 commit comments

Comments
 (0)