From 4a15c40bad33e7ede06cbb9ce89dec11913e0399 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 7 Jun 2026 15:39:33 -0400 Subject: [PATCH 1/7] Adding rust caching in workflow --- .github/workflows/workflow.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index e1a1a36..55c5750 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -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 -- 2.47.3 From 2aeb45dec7ddf5441fc9e940eaf1498006490a3b Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 7 Jun 2026 15:40:32 -0400 Subject: [PATCH 2/7] Fixed branch issue in workflow --- .github/workflows/workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 55c5750..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: -- 2.47.3 From 14165533c9860f0fb6395246d6aea00feffed04e Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 7 Jun 2026 15:42:16 -0400 Subject: [PATCH 3/7] Updating swoosh and textsender_models --- Cargo.lock | 9 ++++----- Cargo.toml | 6 ++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 856ea61..292773f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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..a84c8c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,13 +5,11 @@ 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" } -- 2.47.3 From c0ba58481aeeb363019cd558dfe301811e934565 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 7 Jun 2026 15:43:18 -0400 Subject: [PATCH 4/7] cargo update --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 292773f..490b51d 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" -- 2.47.3 From e8ce43b78f558a6a063337fb895e82ea651d9e29 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 7 Jun 2026 15:43:50 -0400 Subject: [PATCH 5/7] bump: sender --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 490b51d..0fe1390 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1699,7 +1699,7 @@ checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" [[package]] name = "sender" -version = "0.1.0" +version = "0.1.1" dependencies = [ "async-std", "futures", diff --git a/Cargo.toml b/Cargo.toml index a84c8c0..e7559c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sender" -version = "0.1.0" +version = "0.1.1" edition = "2024" rust-version = "1.95" -- 2.47.3 From 752f3b02158b6dd706a790bc9cd82e55894c5ce6 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 7 Jun 2026 15:46:30 -0400 Subject: [PATCH 6/7] Updating function parameter type --- src/messaging/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/messaging/mod.rs b/src/messaging/mod.rs index a7f1893..418cdd4 100644 --- a/src/messaging/mod.rs +++ b/src/messaging/mod.rs @@ -4,7 +4,7 @@ use textsender_models::message::Message; pub async fn send_messages( config: &TwilioConfig, - contacts: &Vec, + contacts: &[Contact], message: &Message, second_interval: u64, ) { -- 2.47.3 From b105c1aa8870706f15409f3abb851150e1d8188f Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 7 Jun 2026 15:57:56 -0400 Subject: [PATCH 7/7] Fixing warnings --- src/messaging/mod.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/messaging/mod.rs b/src/messaging/mod.rs index 418cdd4..f8b46ed 100644 --- a/src/messaging/mod.rs +++ b/src/messaging/mod.rs @@ -9,9 +9,8 @@ pub async fn send_messages( 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; } } -- 2.47.3