Skip to content

Commit 89455a2

Browse files
author
Bruno Grande
committed
Address PR feedback
1 parent 30b09ed commit 89455a2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/orca/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,4 @@
2525
# Configure a module logger
2626
logger = logging.getLogger(__name__)
2727
logger.setLevel(logging.INFO)
28-
logger.handlers.clear()
2928
logger.addHandler(handler)

src/orca/services/nextflowtower/ops.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import logging
12
from dataclasses import field
23
from functools import cached_property
34
from typing import ClassVar, Optional
45

56
from pydantic.dataclasses import dataclass
67

7-
from orca import logger
88
from orca.errors import ConfigError
99
from orca.services.base.ops import BaseOps
1010
from orca.services.nextflowtower.client import NextflowTowerClient
@@ -13,6 +13,8 @@
1313
from orca.services.nextflowtower.models import LaunchInfo, Workflow, WorkflowStatus
1414
from orca.services.nextflowtower.utils import increment_suffix
1515

16+
logger = logging.getLogger(__name__)
17+
1618

1719
@dataclass(kw_only=False)
1820
class NextflowTowerOps(BaseOps):
@@ -133,19 +135,18 @@ def launch_workflow(
133135
latest_run = self.get_latest_previous_workflow(launch_info)
134136
if latest_run:
135137
status = latest_run.status.value
136-
run_repr = f"{latest_run.run_name} ({latest_run.id})"
138+
run_repr = f"{latest_run.run_name} (id='{latest_run.id}', {status=})"
137139
# Return ID for latest run if ongoing, succeeded, or cancelled
138-
skip_statuses = {"SUCCEEDED"}
139140
if not latest_run.is_done: # pragma: no cover
140141
logger.info(f"Found an ongoing previous run: {run_repr}")
141142
return latest_run.id
142-
if latest_run.status in skip_statuses:
143-
logger.info(f"Found a previous ({status}) run: {run_repr}")
143+
if status in {"SUCCEEDED", "UNKNOWN"}:
144+
logger.info(f"Found a previous run: {run_repr}")
144145
return latest_run.id
145146
launch_info.fill_in("resume", True)
146147
launch_info.fill_in("session_id", latest_run.session_id)
147148
launch_info.run_name = increment_suffix(latest_run.run_name)
148-
logger.info(f"Relaunching from a previous ({status}) run: {run_repr}")
149+
logger.info(f"Relaunching from a previous run: {run_repr}")
149150

150151
# Get relevant compute environment and its resource tags
151152
compute_env_id = self.get_latest_compute_env(compute_env_filter)

0 commit comments

Comments
 (0)