From 6396bc861b3196cb654f7270c4987a5084ba90d1 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 7 Jun 2026 16:02:46 -0400 Subject: [PATCH] Update dependencies (#5) Reviewed-on: http://git.kundeng.us/phoenix/sender/pulls/5 --- .github/workflows/workflow.yml | 9 +++++++-- Cargo.lock | 15 +++++++-------- Cargo.toml | 8 +++----- src/messaging/mod.rs | 9 +++------ 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index e1a1a36..157d9a2 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -3,10 +3,10 @@ name: sender Build on: push: branches: - - v0.1.x + - main pull_request: branches: - - v0.1.x + - main jobs: check: @@ -17,6 +17,7 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: 1.95 + - uses: Swatinem/rust-cache@v2 - run: | mkdir -p ~/.ssh echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/deploy_key @@ -35,6 +36,7 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: 1.95 + - uses: Swatinem/rust-cache@v2 env: AUTH_SID: 'n9c43yr3f2c4743f7y4329dnq238f7' AUTH_TOKEN: '9nmc4820qf4cor838r4fy3o84rfy348fyr' @@ -60,6 +62,7 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: 1.95 + - uses: Swatinem/rust-cache@v2 - run: rustup component add rustfmt - run: | mkdir -p ~/.ssh @@ -79,6 +82,7 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: 1.95 + - uses: Swatinem/rust-cache@v2 - run: rustup component add clippy - run: | mkdir -p ~/.ssh @@ -98,6 +102,7 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: 1.95 + - uses: Swatinem/rust-cache@v2 - run: | mkdir -p ~/.ssh echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/deploy_key diff --git a/Cargo.lock b/Cargo.lock index 856ea61..0fe1390 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -178,9 +178,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64-ng" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452b0c98385f31f08318109d6e06a859f89e0c5e38aad6103f095443b063052" +checksum = "8992e20e420add1e6e31c6c548a4ba698ed9339bb0863b37478427179c56f05d" [[package]] name = "bitflags" @@ -1699,7 +1699,7 @@ checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" [[package]] name = "sender" -version = "0.1.0" +version = "0.1.1" dependencies = [ "async-std", "futures", @@ -1839,8 +1839,8 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "swoosh" -version = "0.3.1" -source = "git+ssh://git@git.kundeng.us/phoenix/swoosh.git?tag=v0.3.1-main-ab01daafea-871#ab01daafeaa9da1209f08ca946893f3dd0a3aad5" +version = "0.3.2" +source = "git+ssh://git@git.kundeng.us/phoenix/swoosh.git?tag=v0.3.2#122f1183ac0e7b6ea7229d10d3f6d385fbfa047c" dependencies = [ "base64-ng", "const_format", @@ -1911,13 +1911,12 @@ dependencies = [ [[package]] name = "textsender_models" -version = "0.2.5" -source = "git+ssh://git@git.kundeng.us/phoenix/textsender-models.git?tag=v0.2.5-v0.3.0-migrate-38dbcb09f7-111#38dbcb09f7c2c572f429ec382c01e14b72b1d615" +version = "0.3.0" +source = "git+ssh://git@git.kundeng.us/phoenix/textsender-models.git?tag=v0.3.0#d504108745b7b97a02eac24e16763cdb5e731f2b" dependencies = [ "const_format", "dotenvy", "josekit", - "rand 0.10.1", "serde", "serde_json", "time", diff --git a/Cargo.toml b/Cargo.toml index b9ffaa0..e7559c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,17 +1,15 @@ [package] name = "sender" -version = "0.1.0" +version = "0.1.1" edition = "2024" rust-version = "1.95" [dependencies] -# uuid = { version = "1.23.1", features = ["v4", "serde"] } -# serde = { version = "1.0.228", features = ["derive"] } serde_json = { version = "1.0.149" } tokio = { version = "1.52.2", features = ["full"] } futures = { version = "0.3.32" } -textsender_models = { git = "ssh://git@git.kundeng.us/phoenix/textsender-models.git", tag = "v0.2.5-v0.3.0-migrate-38dbcb09f7-111" } -swoosh = { git = "ssh://git@git.kundeng.us/phoenix/swoosh.git", tag = "v0.3.1-main-ab01daafea-871" } +textsender_models = { git = "ssh://git@git.kundeng.us/phoenix/textsender-models.git", tag = "v0.3.0" } +swoosh = { git = "ssh://git@git.kundeng.us/phoenix/swoosh.git", tag = "v0.3.2" } [dev-dependencies] async-std = { version = "1.13.2" } diff --git a/src/messaging/mod.rs b/src/messaging/mod.rs index a7f1893..f8b46ed 100644 --- a/src/messaging/mod.rs +++ b/src/messaging/mod.rs @@ -4,14 +4,13 @@ use textsender_models::message::Message; pub async fn send_messages( config: &TwilioConfig, - contacts: &Vec, + contacts: &[Contact], message: &Message, second_interval: u64, ) { let long_sleep_limit: i64 = 5; - let mut count: i64 = 0; - for contact in contacts.iter() { + for (text_count, contact) in (0_i64..).zip(contacts.iter()) { println!("Sending to: {:?}", contact.phone_number); let param = swoosh::twilio::types::Parameters { schedule: false, @@ -28,7 +27,7 @@ pub async fn send_messages( } } - if count % long_sleep_limit == 0 { + if text_count % long_sleep_limit == 0 { // Sleep for X seconds let wait_time = second_interval; std::thread::sleep(std::time::Duration::from_secs(wait_time)); @@ -36,8 +35,6 @@ pub async fn send_messages( // Sleep for a second std::thread::sleep(std::time::Duration::from_secs(1)); } - - count += 1; } }