Skip to content

Commit

Permalink
chore: fix queries and install script
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterPtato committed Apr 23, 2024
1 parent bf934cd commit f2de71c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions svc/pkg/cluster/standalone/gc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ pub async fn run_from_env(ts: i64, pools: rivet_pools::Pools) -> GlobalResult<()
[ctx, ServerRow, @tx tx]
"
SELECT server_id, datacenter_id, pool_type, drain_ts
FROM db_cluster.datacenters AS d
FROM db_cluster.servers
WHERE
s.datacenter_id = d.datacenter_id AND
pool_type = ANY($1) AND
cloud_destroy_ts IS NULL AND
drain_ts IS NOT NULL
Expand All @@ -47,6 +46,10 @@ pub async fn run_from_env(ts: i64, pools: rivet_pools::Pools) -> GlobalResult<()
)
.await?;

if servers.is_empty() {
return Ok(Vec::new());
}

let datacenters_res = op!([ctx] cluster_datacenter_get {
datacenter_ids: servers
.iter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ while true; do
response=$(
curl -f \
-H "Authorization: Bearer __SERVER_TOKEN__" \
"http://127.0.0.1:__API_INTERNAL_PORT__/provision/datacenters/___DATACENTER_ID___/tls"
"http://127.0.0.1:__TUNNEL_API_INTERNAL_PORT__/provision/datacenters/___DATACENTER_ID___/tls"
) && break || sleep 5
done
Expand Down

0 comments on commit f2de71c

Please sign in to comment.