From 5e1d84105417dbd2774dbd2332287b4349a30705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arturo=20Filast=C3=B2?= Date: Fri, 6 Sep 2024 12:07:04 -0400 Subject: [PATCH] Fix reschedule command --- oonipipeline/src/oonipipeline/cli/commands.py | 5 ---- .../temporal/client_operations.py | 23 ++++++++++++++++++- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/oonipipeline/src/oonipipeline/cli/commands.py b/oonipipeline/src/oonipipeline/cli/commands.py index 23f971fb..4fe02a60 100644 --- a/oonipipeline/src/oonipipeline/cli/commands.py +++ b/oonipipeline/src/oonipipeline/cli/commands.py @@ -206,11 +206,6 @@ def schedule( @cli.command() @probe_cc_option @test_name_option -@click.option( - "--fast-fail", - is_flag=True, - help="should we fail immediately when we encounter an error?", -) def reschedule( probe_cc: List[str], test_name: List[str], diff --git a/oonipipeline/src/oonipipeline/temporal/client_operations.py b/oonipipeline/src/oonipipeline/temporal/client_operations.py index ab3177b8..fd5235e7 100644 --- a/oonipipeline/src/oonipipeline/temporal/client_operations.py +++ b/oonipipeline/src/oonipipeline/temporal/client_operations.py @@ -8,6 +8,7 @@ ScheduleIdMap, schedule_all, schedule_backfill, + reschedule_all, ) from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter @@ -153,6 +154,26 @@ async def create_schedules( ) +async def reschedule( + probe_cc: List[str], + test_name: List[str], + clickhouse_url: str, + data_dir: str, + temporal_config: TemporalConfig, +) -> ScheduleIdMap: + log.info(f"rescheduling everything") + + client = await temporal_connect(temporal_config=temporal_config) + + return await reschedule_all( + client=client, + probe_cc=probe_cc, + test_name=test_name, + clickhouse_url=clickhouse_url, + data_dir=data_dir, + ) + + async def get_status( temporal_config: TemporalConfig, ) -> Tuple[List[WorkflowExecution], List[WorkflowExecution]]: @@ -243,7 +264,7 @@ def run_reschedule( ): try: asyncio.run( - create_schedules( + reschedule( probe_cc=probe_cc, test_name=test_name, clickhouse_url=clickhouse_url,