Skip to content

Commit 4b75e12

Browse files
committed
trash settings
1 parent d26de9a commit 4b75e12

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

services/static-webserver/client/source/class/osparc/store/StaticInfo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ qx.Class.define("osparc.store.StaticInfo", {
7070
},
7171

7272
getTrashRetentionDays: function() {
73-
const staticKey = "webserverProjects";
73+
const staticKey = "webserverTrash";
7474
const wsStaticData = this.getValue(staticKey);
75-
const key = "PROJECTS_TRASH_RETENTION_DAYS";
75+
const key = "TRASH_RETENTION_DAYS";
7676
if (key in wsStaticData) {
7777
return wsStaticData[key];
7878
}

services/web/server/src/simcore_service_webserver/application_settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,15 +266,13 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
266266
WEBSERVER_RABBITMQ: Annotated[
267267
RabbitSettings | None,
268268
Field(
269-
description="rabbitmq plugin",
270269
json_schema_extra={"auto_default_from_env": True},
271270
),
272271
]
273272

274273
WEBSERVER_USERS: Annotated[
275274
UsersSettings | None,
276275
Field(
277-
description="users plugin",
278276
json_schema_extra={"auto_default_from_env": True},
279277
),
280278
]
@@ -455,7 +453,9 @@ def to_client_statics(self) -> dict[str, Any]:
455453
"SWARM_STACK_NAME": True,
456454
"WEBSERVER_PROJECTS": {
457455
"PROJECTS_MAX_NUM_RUNNING_DYNAMIC_NODES",
458-
"PROJECTS_TRASH_RETENTION_DAYS",
456+
},
457+
"WEBSERVER_TRASH": {
458+
"TRASH_RETENTION_DAYS",
459459
},
460460
"WEBSERVER_LOGIN": {
461461
"LOGIN_ACCOUNT_DELETION_RETENTION_DAYS",

services/web/server/src/simcore_service_webserver/projects/settings.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ class ProjectsSettings(BaseCustomSettings):
2323
description="interval after which services need to be idle in order to be considered inactive",
2424
)
2525

26-
PROJECTS_TRASH_RETENTION_DAYS: NonNegativeInt = Field(
27-
default=7, description="Trashed items will be deleted after this time"
28-
)
29-
3026

3127
def get_plugin_settings(app: web.Application) -> ProjectsSettings:
3228
settings = app[APP_SETTINGS_KEY].WEBSERVER_PROJECTS

services/web/server/src/simcore_service_webserver/trash/_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async def empty_trash(app: web.Application, product_name: ProductName, user_id:
2424

2525
async def prune_trash(app: web.Application) -> list[str]:
2626
settings = get_plugin_settings(app)
27-
retention = timedelta(days=settings.PROJECTS_TRASH_RETENTION_DAYS)
27+
retention = timedelta(days=settings.TRASH_RETENTION_DAYS)
2828

2929
_logger.debug(
3030
"CODE PLACEHOLDER: **ALL** projects marked as trashed during %s days are deleted",

services/web/server/src/simcore_service_webserver/trash/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
class TrashSettings(BaseCustomSettings):
99
TRASH_RETENTION_DAYS: NonNegativeInt = Field(
10-
default=7, description="Trashed items will be deleted after this time"
10+
default=7,
11+
description="Trashed items will be deleted after this time",
12+
alias="PROJECTS_TRASH_RETENTION_DAYS",
1113
)
1214

1315

0 commit comments

Comments
 (0)