Skip to content

Commit

Permalink
server: python cluster worker routing
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Nov 19, 2024
1 parent 1c18129 commit 459b95a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions server/python/cluster_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class ClusterForkOptions(TypedDict):
runtime: Optional[str]
labels: Optional[Dict[str, List[str]]]
id: Optional[str]
clusterWorkerId: Optional[str]


def matches_cluster_labels(options: ClusterForkOptions, labels: List[str]) -> int:
Expand Down Expand Up @@ -46,6 +47,5 @@ def needs_cluster_fork_worker(options: ClusterForkOptions) -> bool:
return (
os.environ.get("SCRYPTED_CLUSTER_ADDRESS")
and options
and options.get("runtime", None)
and not matches_cluster_labels(options, get_cluster_labels())
and (not matches_cluster_labels(options, get_cluster_labels()) or options.get("clusterWorkerId", None))
)

0 comments on commit 459b95a

Please sign in to comment.