Skip to content

Commit

Permalink
chore: misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterPtato committed Oct 18, 2024
1 parent 34172ff commit 8379c6a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ tracing = "0.1"
url = "2.5.2"
uuid = "1.10.0"

# Standalone
# Standalone
cluster-datacenter-tls-renew = { path = "../../svc/pkg/cluster/standalone/datacenter-tls-renew" }
cluster-gc = { path = "../../svc/pkg/cluster/standalone/gc" }
cluster-metrics-publish = { path = "../../svc/pkg/cluster/standalone/metrics-publish" }
Expand Down
1 change: 0 additions & 1 deletion lib/pegboard/v8-isolate-runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ deno_core = "0.312.0"
futures-util = { version = "0.3" }
netif = "0.1.6"
nix = { version = "0.27", default-features = false, features = ["user", "signal"] }
rand = "0.8"
serde = { version = "1.0.195", features = ["derive"] }
serde_json = "1.0.111"
signal-hook = "0.3.17"
Expand Down
5 changes: 1 addition & 4 deletions lib/pegboard/v8-isolate-runner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::{collections::HashMap, path::Path, time::Duration};
use anyhow::*;
use deno_runtime::deno_core::JsRuntime;
use futures_util::{stream::SplitStream, StreamExt};
use rand::Rng;
use tokio::{
fs,
net::TcpStream,
Expand Down Expand Up @@ -132,9 +131,7 @@ async fn handle_connection(
break;
}

let jitter =
Duration::from_millis(rand::thread_rng().gen_range(0..100));
tokio::time::sleep(THREAD_STATUS_POLL + jitter).await
tokio::time::sleep(THREAD_STATUS_POLL).await
}
});

Expand Down
2 changes: 1 addition & 1 deletion svc/pkg/cluster/standalone/default-update/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub async fn start(use_autoscaler: bool) -> GlobalResult<()> {
}

#[tracing::instrument]
pub async fn start_inner(use_autoscaler: bool) -> GlobalResult<()> {
async fn start_inner(use_autoscaler: bool) -> GlobalResult<()> {
let pools = rivet_pools::from_env().await?;
let client =
chirp_client::SharedClient::from_env(pools.clone())?.wrap_new("cluster-default-update");
Expand Down
16 changes: 8 additions & 8 deletions svc/pkg/monolith/standalone/worker/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
use rivet_operation::prelude::*;

pub async fn start() -> GlobalResult<()> {
let pools = rivet_pools::from_env().await?;

run_from_env(pools).await?;

Ok(())
}

macro_rules! spawn_workers {
([$shared_client:ident, $pools:ident, $cache:ident, $join_set:ident] $($pkg:ident),* $(,)?) => {
$(
Expand All @@ -21,6 +13,14 @@ macro_rules! spawn_workers {
};
}

pub async fn start() -> GlobalResult<()> {
let pools = rivet_pools::from_env().await?;

run_from_env(pools).await?;

Ok(())
}

#[tracing::instrument(skip_all)]
pub async fn run_from_env(pools: rivet_pools::Pools) -> GlobalResult<()> {
let shared_client = chirp_client::SharedClient::from_env(pools.clone())?;
Expand Down

0 comments on commit 8379c6a

Please sign in to comment.