Skip to content

Commit

Permalink
Fix reschedule command
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Sep 6, 2024
1 parent da89f2d commit 5e1d841
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
5 changes: 0 additions & 5 deletions oonipipeline/src/oonipipeline/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
23 changes: 22 additions & 1 deletion oonipipeline/src/oonipipeline/temporal/client_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
ScheduleIdMap,
schedule_all,
schedule_backfill,
reschedule_all,
)

from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
Expand Down Expand Up @@ -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")

Check warning on line 164 in oonipipeline/src/oonipipeline/temporal/client_operations.py

View check run for this annotation

Codecov / codecov/patch

oonipipeline/src/oonipipeline/temporal/client_operations.py#L164

Added line #L164 was not covered by tests

client = await temporal_connect(temporal_config=temporal_config)

Check warning on line 166 in oonipipeline/src/oonipipeline/temporal/client_operations.py

View check run for this annotation

Codecov / codecov/patch

oonipipeline/src/oonipipeline/temporal/client_operations.py#L166

Added line #L166 was not covered by tests

return await reschedule_all(

Check warning on line 168 in oonipipeline/src/oonipipeline/temporal/client_operations.py

View check run for this annotation

Codecov / codecov/patch

oonipipeline/src/oonipipeline/temporal/client_operations.py#L168

Added line #L168 was not covered by tests
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]]:
Expand Down Expand Up @@ -243,7 +264,7 @@ def run_reschedule(
):
try:
asyncio.run(

Check warning on line 266 in oonipipeline/src/oonipipeline/temporal/client_operations.py

View check run for this annotation

Codecov / codecov/patch

oonipipeline/src/oonipipeline/temporal/client_operations.py#L265-L266

Added lines #L265 - L266 were not covered by tests
create_schedules(
reschedule(
probe_cc=probe_cc,
test_name=test_name,
clickhouse_url=clickhouse_url,
Expand Down

0 comments on commit 5e1d841

Please sign in to comment.