Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions src/echodataflow/flows/flows_acoustics.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@

from prefect import flow, get_run_logger, get_client
from prefect.futures import as_completed
from prefect.states import Cancelled, Failed
from prefect.states import Failed
from prefect import runtime
from prefect.events import emit_event

from echodataflow.flows.flows_helper import deployment_already_running
from echodataflow.deployment.task_runners import dask_task_runner_from_environment
from echodataflow.utils.manifests import (
MVBS_COLUMNS_POSTPROCESSING,
Expand Down Expand Up @@ -77,20 +76,6 @@ def flow_raw2Sv(
add_splitbeam_angle: bool = False,
):

# Check if the deployment is already running
already_running = asyncio.run(deployment_already_running())
if already_running:

async def cancel_run():
async with get_client() as client:
await client.set_flow_run_state(
flow_run_id=runtime.flow_run.id,
state=Cancelled(message="Another instance of this flow is already running"),
)

asyncio.run(cancel_run())
return # exit the flow early

# Assemble paths
path_Sv_zarr = Path(path_main) / "Sv"
file_Sv_csv = Path(path_main) / file_Sv_csv
Expand Down
16 changes: 0 additions & 16 deletions tests/test_flow_raw2sv.py → tests/test_flow_raw2Sv.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
from echodataflow.flows import flows_acoustics


async def _false_async():
return False


def test_flow_raw2sv_uses_processing_ledger(monkeypatch, tmp_path):
raw_file = tmp_path / "example.raw"

Expand All @@ -20,12 +16,6 @@ def test_flow_raw2sv_uses_processing_ledger(monkeypatch, tmp_path):
"completed": [],
}

monkeypatch.setattr(
flows_acoustics,
"deployment_already_running",
lambda: _false_async(),
)

monkeypatch.setattr(
flows_acoustics,
"initialize_ledger",
Expand Down Expand Up @@ -98,12 +88,6 @@ def test_flow_raw2sv_marks_failed(monkeypatch, tmp_path):
"failed": [],
}

monkeypatch.setattr(
flows_acoustics,
"deployment_already_running",
lambda: _false_async(),
)

monkeypatch.setattr(
flows_acoustics,
"initialize_ledger",
Expand Down