Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: misc fixes #1224

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading