Skip to content

Commit

Permalink
fix(repo): small adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Dec 27, 2024
1 parent 0c6a68a commit 839fc58
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ AWS_ENDPOINT_URL=http://localhost:4566
AWS_REGION=us-east-1
AWS_S3_ENABLED=false
AWS_S3_BUCKET_NAME=fuel-streams-local
STORAGE_MAX_RETRIES=5

# NATS Configuration
NATS_URL=nats://localhost:4222
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,16 @@ jobs:
tool: cargo-nextest
locked: true

- name: Start Nats
- name: Start Docker
run: |
make start-nats
make start-docker
- name: Run tests
run: make test PACKAGE=${{ matrix.package }} PROFILE=ci

- name: Stop Nats
- name: Stop Docker
if: always()
run: make stop-nats
run: make stop-docker

build:
needs: install-deps
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions crates/fuel-streams-executors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ publish = false
[dependencies]
anyhow = { workspace = true }
displaydoc = { workspace = true }
dotenvy = { workspace = true }
fuel-core = { workspace = true }
fuel-data-parser = { workspace = true, features = ["test-helpers"] }
fuel-streams-core = { workspace = true, features = ["test-helpers"] }
Expand Down
3 changes: 1 addition & 2 deletions crates/fuel-streams-executors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ pub mod transactions;
pub mod utxos;

use std::{
env,
marker::PhantomData,
sync::{Arc, LazyLock},
};
Expand All @@ -21,7 +20,7 @@ use tokio::task::JoinHandle;

pub static PUBLISHER_MAX_THREADS: LazyLock<usize> = LazyLock::new(|| {
let available_cpus = num_cpus::get();
env::var("PUBLISHER_MAX_THREADS")
dotenvy::var("PUBLISHER_MAX_THREADS")
.ok()
.and_then(|val| val.parse().ok())
.unwrap_or(available_cpus)
Expand Down
11 changes: 9 additions & 2 deletions crates/fuel-streams-storage/src/retry.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
use std::{future::Future, time::Duration};
use std::{future::Future, sync::LazyLock, time::Duration};

use tracing;

pub static STORAGE_MAX_RETRIES: LazyLock<usize> = LazyLock::new(|| {
dotenvy::var("STORAGE_MAX_RETRIES")
.ok()
.and_then(|val| val.parse().ok())
.unwrap_or(5)
});

#[derive(Debug, Clone)]
pub struct RetryConfig {
pub max_retries: u32,
Expand All @@ -11,7 +18,7 @@ pub struct RetryConfig {
impl Default for RetryConfig {
fn default() -> Self {
Self {
max_retries: 3,
max_retries: *STORAGE_MAX_RETRIES as u32,
initial_backoff: Duration::from_millis(100),
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/sv-consumer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ async fn setup_nats(

pub static CONSUMER_MAX_THREADS: LazyLock<usize> = LazyLock::new(|| {
let available_cpus = num_cpus::get();
env::var("CONSUMER_MAX_THREADS")
dotenvy::var("CONSUMER_MAX_THREADS")
.ok()
.and_then(|val| val.parse().ok())
.unwrap_or(available_cpus)
Expand Down

0 comments on commit 839fc58

Please sign in to comment.