Skip to content

Commit 335b37e

Browse files
authored
OS temp path for image server (#1302)
1 parent b5e8a14 commit 335b37e

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"black>=22.1,<24",
99
"dash[testing]",
1010
"isort",
11-
"mypy",
11+
"mypy<1.12",
1212
"pylint<3.2.0",
1313
"pytest-mock",
1414
"pytest-xdist",

webviz_subsurface/_providers/ensemble_surface_provider/surface_image_server.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@
33
import json
44
import logging
55
import math
6+
import tempfile
67
from dataclasses import asdict, dataclass
78
from typing import Any, List, Optional, Tuple, Union
89
from urllib.parse import quote
9-
from uuid import uuid4
1010

1111
import flask
1212
import flask_caching
1313
import xtgeo
1414
from dash import Dash
15-
from webviz_config.webviz_instance_info import WEBVIZ_INSTANCE_INFO
1615

1716
from webviz_subsurface._utils.perf_timer import PerfTimer
1817

@@ -46,10 +45,7 @@ class SurfaceImageMeta:
4645

4746
class SurfaceImageServer:
4847
def __init__(self, app: Dash) -> None:
49-
cache_dir = (
50-
WEBVIZ_INSTANCE_INFO.storage_folder
51-
/ f"SurfaceImageServer_filecache_{uuid4()}"
52-
)
48+
cache_dir = tempfile.mkdtemp()
5349
LOGGER.debug(f"Setting up file cache in: {cache_dir}")
5450
self._image_cache = flask_caching.Cache(
5551
config={

0 commit comments

Comments
 (0)