Skip to content
Merged
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
4 changes: 2 additions & 2 deletions crates/hypercolor-daemon/src/cloud_socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub enum CloudSocketError {
}

const MISSED_HEARTBEAT_LIMIT: u8 = 3;
const MAX_HEARTBEAT_INTERVAL: Duration = Duration::from_secs(3_600);
const MAX_HEARTBEAT_INTERVAL: Duration = Duration::from_hours(1);

#[derive(Debug, Clone, Copy, PartialEq)]
pub struct CloudReconnectPolicy {
Expand All @@ -57,7 +57,7 @@ impl Default for CloudReconnectPolicy {
fn default() -> Self {
Self {
initial_delay: Duration::from_secs(1),
max_delay: Duration::from_secs(60),
max_delay: Duration::from_mins(1),
backoff_factor: 2.0,
jitter: 0.25,
}
Expand Down
8 changes: 2 additions & 6 deletions crates/hypercolor-daemon/tests/cloud_api_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async fn cloud_status_reports_compiled_config_without_keyring_access() {
#[tokio::test]
async fn cloud_login_start_stores_session_without_returning_device_code() {
let (auth_base_url, shutdown_tx, task) = spawn_auth_server().await;
let app = api::build_router(cloud_test_state(&auth_base_url), None);
let app = api::build_router(cloud_test_state_with_cloud(&auth_base_url, true), None);

let response = app
.oneshot(
Expand Down Expand Up @@ -147,7 +147,7 @@ async fn cloud_login_start_rejects_when_pending_session_limit_reached() {
#[tokio::test]
async fn cloud_login_poll_keeps_pending_session_retryable() {
let (auth_base_url, shutdown_tx, task) = spawn_auth_server().await;
let app = api::build_router(cloud_test_state(&auth_base_url), None);
let app = api::build_router(cloud_test_state_with_cloud(&auth_base_url, true), None);

let start = app
.clone()
Expand Down Expand Up @@ -979,10 +979,6 @@ impl CloudSessionStatusFixture {
}
}

fn cloud_test_state(auth_base_url: &str) -> Arc<AppState> {
cloud_test_state_with_cloud(auth_base_url, false)
}

fn cloud_test_state_with_cloud(auth_base_url: &str, enabled: bool) -> Arc<AppState> {
let tempdir = TempDir::new().expect("temp dir should be created");
let manager = ConfigManager::new(tempdir.path().join("config.toml"))
Expand Down
6 changes: 3 additions & 3 deletions crates/hypercolor-daemon/tests/cloud_socket_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,10 @@ fn cloud_reconnect_state_uses_exponential_backoff_with_clamped_jitter() {
);
assert_eq!(delays[5].base_delay, std::time::Duration::from_secs(32));
assert_eq!(delays[5].retry_delay, std::time::Duration::from_secs(40));
assert_eq!(delays[6].base_delay, std::time::Duration::from_secs(60));
assert_eq!(delays[6].base_delay, std::time::Duration::from_mins(1));
assert_eq!(delays[6].retry_delay, std::time::Duration::from_secs(45));
assert_eq!(delays[7].base_delay, std::time::Duration::from_secs(60));
assert_eq!(delays[7].retry_delay, std::time::Duration::from_secs(60));
assert_eq!(delays[7].base_delay, std::time::Duration::from_mins(1));
assert_eq!(delays[7].retry_delay, std::time::Duration::from_mins(1));
assert_eq!(state.next_attempt(), 8);
}

Expand Down
Loading