Skip to content

Commit

Permalink
first use
Browse files Browse the repository at this point in the history
  • Loading branch information
tdyas committed Aug 15, 2024
1 parent 14010ec commit 4ead98d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/python/pants/engine/internals/native_engine.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from __future__ import annotations

from datetime import datetime
from datetime import datetime, timedelta
from io import RawIOBase
from typing import (
Any,
Expand Down Expand Up @@ -863,7 +863,7 @@ def session_record_test_observation(
) -> None: ...
def session_isolated_shallow_clone(session: PySession, build_id: str) -> PySession: ...
def session_wait_for_tail_tasks(
scheduler: PyScheduler, session: PySession, timeout: float
scheduler: PyScheduler, session: PySession, timeout: timedelta
) -> None: ...
def graph_len(scheduler: PyScheduler) -> int: ...
def graph_visualize(scheduler: PyScheduler, session: PySession, path: str) -> None: ...
Expand Down
3 changes: 2 additions & 1 deletion src/python/pants/engine/internals/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import time
from dataclasses import dataclass
from datetime import timedelta
from pathlib import PurePath
from types import CoroutineType
from typing import Any, Callable, Dict, Iterable, NoReturn, Sequence, cast
Expand Down Expand Up @@ -661,7 +662,7 @@ def is_cancelled(self) -> bool:
def cancel(self) -> None:
self.py_session.cancel()

def wait_for_tail_tasks(self, timeout: float) -> None:
def wait_for_tail_tasks(self, timeout: timedelta) -> None:
native_engine.session_wait_for_tail_tasks(self.py_scheduler, self.py_session, timeout)


Expand Down
6 changes: 3 additions & 3 deletions src/rust/engine/src/externs/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use pyo3::prelude::{
pyclass, pyfunction, pymethods, pymodule, wrap_pyfunction, PyModule, PyObject,
PyResult as PyO3Result, Python, ToPyObject,
};
use pyo3::types::{PyBytes, PyDict, PyList, PyTuple, PyType};
use pyo3::types::{PyBytes, PyDelta, PyDict, PyList, PyTuple, PyType};
use pyo3::{create_exception, IntoPy, PyAny, PyRef};
use regex::Regex;
use remote::remote_cache::RemoteCacheWarningsBehavior;
Expand Down Expand Up @@ -1354,10 +1354,10 @@ fn session_wait_for_tail_tasks(
py: Python,
py_scheduler: &PyScheduler,
py_session: &PySession,
timeout: f64,
timeout: &PyDelta,
) -> PyO3Result<()> {
let core = &py_scheduler.0.core;
let timeout = Duration::from_secs_f64(timeout);
let timeout = timeout.extract()?;
core.executor.enter(|| {
py.allow_threads(|| {
core.executor
Expand Down

0 comments on commit 4ead98d

Please sign in to comment.