A batch run skips the nodes waiting on a failed one and ends error; a run whose nodes cannot load fails with the load error before anything executes; cancelling a run stops its pipeline without announcing a pause of the live flow; batch_issues refuses a delay node's interval; the client accepts an engine URL with or without /api/v1; RedisState's compare-and-swap records the names it writes
This commit is contained in:
@@ -170,6 +170,11 @@ class Conflict(ApiError):
|
||||
self.current_version = int(detail.get("current_version") or 0)
|
||||
|
||||
|
||||
def engine_url(url: str) -> str:
|
||||
"""An engine's address, whether it was given with the API's path or not."""
|
||||
return url.rstrip("/").removesuffix(API).rstrip("/")
|
||||
|
||||
|
||||
class Client:
|
||||
"""An authenticated engine, addressed over its HTTP API."""
|
||||
|
||||
@@ -182,7 +187,9 @@ class Client:
|
||||
retries: int = RETRIES,
|
||||
) -> None:
|
||||
stored = _stored()
|
||||
self.url = url or os.environ.get("FLUKSIO_URL") or stored.get("url") or ""
|
||||
self.url = engine_url(
|
||||
url or os.environ.get("FLUKSIO_URL") or stored.get("url") or ""
|
||||
)
|
||||
self.token = (
|
||||
token or os.environ.get("FLUKSIO_TOKEN") or stored.get("token") or ""
|
||||
)
|
||||
@@ -766,8 +773,9 @@ def login(
|
||||
"""Exchange credentials for a token and remember the engine."""
|
||||
import httpx
|
||||
|
||||
url = engine_url(url)
|
||||
response = httpx.post(
|
||||
f"{url.rstrip('/')}{API}/login/access-token",
|
||||
f"{url}{API}/login/access-token",
|
||||
data={"username": email, "password": password},
|
||||
timeout=timeout,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user