Skip to content

Commit

Permalink
Check the instance in the existing ones before adding them
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Mezentsev committed May 8, 2024
1 parent ba17875 commit d6a8a38
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/dstack/_internal/server/services/pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ async def add_remote(
pools = await list_project_pool_models(session, project)
for pool in pools:
for instance in pool.instances:
if instance.deleted:
continue
if instance.remote_connection_info is not None:
rci = RemoteConnectionInfo.__response__.parse_raw(instance.remote_connection_info)
if rci.host == host and rci.port == port and rci.ssh_user == ssh_user:
Expand Down

0 comments on commit d6a8a38

Please sign in to comment.