Skip to content

Commit

Permalink
Missed in last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Jun 8, 2021
1 parent 282df14 commit 57868ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
13 changes: 5 additions & 8 deletions services/storage/src/simcore_service_storage/dsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
get_location_from_id,
projects,
)
from .s3 import get_config_s3
from .s3wrapper.s3_client import MinioClientWrapper
from .settings import Settings
from .utils import download_to_file_or_raise, expo

logger = logging.getLogger(__name__)
Expand All @@ -64,19 +64,16 @@

def setup_dsm(app: web.Application):
async def _cleanup_context(app: web.Application):
main_cfg = app[APP_CONFIG_KEY]
s3_cfg = get_config_s3(app)
cfg: Settings = app[APP_CONFIG_KEY]

with ThreadPoolExecutor(
max_workers=main_cfg["STORAGE_MAX_WORKERS"]
) as executor:
with ThreadPoolExecutor(max_workers=cfg.STORAGE_MAX_WORKERS) as executor:
dsm = DataStorageManager(
s3_client=app.get(APP_S3_KEY),
engine=app.get(APP_DB_ENGINE_KEY),
loop=asyncio.get_event_loop(),
pool=executor,
simcore_bucket_name=s3_cfg["bucket_name"],
has_project_db=not main_cfg.get("STORAGE_TESTING", False),
simcore_bucket_name=cfg.STORAGE_S3.bucket_name,
has_project_db=not cfg.STORAGE_TESTING,
app=app,
) # type: ignore

Expand Down
3 changes: 1 addition & 2 deletions services/storage/src/simcore_service_storage/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ async def _setup_s3_bucket(app):
reraise=True,
)
async def do_create_bucket():
s3_bucket = cfg.STORAGE_S3.bucket_name
log.debug("Creating bucket: %s", cfg.STORAGE_S3.json(indent=2))
s3_client.create_bucket(s3_bucket.dict())
s3_client.create_bucket(cfg.STORAGE_S3.bucket_name)

try:
await do_create_bucket()
Expand Down
3 changes: 2 additions & 1 deletion services/storage/src/simcore_service_storage/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class Settings(BaseCustomSettings):
)

STORAGE_MAX_WORKERS: PositiveInt = Field(
8, description="Number of workers for the thead executor pool"
8,
description="Number of workers for the thead executor pool used in DatcoreWrapper",
)

STORAGE_MONITORING_ENABLED: bool = False
Expand Down

0 comments on commit 57868ef

Please sign in to comment.