Skip to content

Commit

Permalink
fix: websocket examples urls
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaro00 committed Oct 29, 2024
1 parent 48a393d commit 8ace68e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions actix-web/websocket-actorless/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::{
use tokio::sync::{mpsc, watch};

const PAUSE_SECS: u64 = 15;
const STATUS_URI: &str = "https://api.shuttle.rs";
const STATUS_URI: &str = "https://api.shuttle.dev/.healthz";

type AppState = (
mpsc::UnboundedSender<WsState>,
Expand Down Expand Up @@ -191,5 +191,5 @@ async fn main() -> ShuttleActixWeb<impl FnOnce(&mut ServiceConfig) + Send + Clon

async fn get_api_status(client: &reqwest::Client) -> bool {
let response = client.get(STATUS_URI).send().await;
response.is_ok()
response.is_ok_and(|r| r.status().is_success())
}
7 changes: 4 additions & 3 deletions axum/websocket/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct State {
}

const PAUSE_SECS: u64 = 15;
const STATUS_URI: &str = "https://api.shuttle.rs";
const STATUS_URI: &str = "https://api.shuttle.dev/.healthz";

#[derive(Serialize)]
struct Response {
Expand All @@ -50,8 +50,9 @@ async fn main() -> ShuttleAxum {
let duration = Duration::from_secs(PAUSE_SECS);

loop {
let is_up = reqwest::get(STATUS_URI).await;
let is_up = is_up.is_ok();
let is_up = reqwest::get(STATUS_URI)
.await
.is_ok_and(|r| r.status().is_success());

let response = Response {
clients_count: state_send.lock().await.clients_count,
Expand Down

0 comments on commit 8ace68e

Please sign in to comment.