Skip to content

Commit

Permalink
refactor(launcher-api): update following code review
Browse files Browse the repository at this point in the history
  • Loading branch information
mabw-rte committed Aug 29, 2024
1 parent 5a22347 commit a7c8994
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
3 changes: 1 addition & 2 deletions antarest/launcher/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging
import os
import shutil
from datetime import datetime, timedelta
from datetime import datetime
from http import HTTPStatus
from pathlib import Path
from typing import Dict, List, Optional, cast
Expand Down Expand Up @@ -59,7 +59,6 @@ def __init__(self, engine: str):
)


ORPHAN_JOBS_VISIBILITY_THRESHOLD = 10 # days
LAUNCHER_PARAM_NAME_SUFFIX = "output_suffix"
EXECUTION_INFO_FILE = "execution_info.ini"

Expand Down
10 changes: 2 additions & 8 deletions tests/launcher/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,7 @@
LauncherParametersDTO,
LogType,
)
from antarest.launcher.service import (
EXECUTION_INFO_FILE,
LAUNCHER_PARAM_NAME_SUFFIX,
ORPHAN_JOBS_VISIBILITY_THRESHOLD,
JobNotFound,
LauncherService,
)
from antarest.launcher.service import EXECUTION_INFO_FILE, LAUNCHER_PARAM_NAME_SUFFIX, JobNotFound, LauncherService
from antarest.login.auth import Auth
from antarest.login.model import Identity
from antarest.study.model import OwnerInfo, PublicMode, Study, StudyMetadataDTO
Expand Down Expand Up @@ -257,7 +251,7 @@ def test_service_get_jobs_from_database(self, db_session) -> None:
job_status=JobStatus.SUCCESS,
msg="Hello, World!",
exit_code=0,
creation_date=now - timedelta(days=ORPHAN_JOBS_VISIBILITY_THRESHOLD + 1),
creation_date=now - timedelta(days=11),
owner=identity_instance,
)
]
Expand Down

0 comments on commit a7c8994

Please sign in to comment.