Skip to content

Commit

Permalink
OS temp path for image server (#1302)
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-kiaer authored Oct 17, 2024
1 parent b5e8a14 commit 335b37e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"black>=22.1,<24",
"dash[testing]",
"isort",
"mypy",
"mypy<1.12",
"pylint<3.2.0",
"pytest-mock",
"pytest-xdist",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
import json
import logging
import math
import tempfile
from dataclasses import asdict, dataclass
from typing import Any, List, Optional, Tuple, Union
from urllib.parse import quote
from uuid import uuid4

import flask
import flask_caching
import xtgeo
from dash import Dash
from webviz_config.webviz_instance_info import WEBVIZ_INSTANCE_INFO

from webviz_subsurface._utils.perf_timer import PerfTimer

Expand Down Expand Up @@ -46,10 +45,7 @@ class SurfaceImageMeta:

class SurfaceImageServer:
def __init__(self, app: Dash) -> None:
cache_dir = (
WEBVIZ_INSTANCE_INFO.storage_folder
/ f"SurfaceImageServer_filecache_{uuid4()}"
)
cache_dir = tempfile.mkdtemp()
LOGGER.debug(f"Setting up file cache in: {cache_dir}")
self._image_cache = flask_caching.Cache(
config={
Expand Down

0 comments on commit 335b37e

Please sign in to comment.