diff --git a/plane/.sqlx/query-c6ec316a814bac95629bb4af740898e538a03f4378f262c8849392ff57b9e22a.json b/plane/.sqlx/query-41e963830001f529faec7d02e28f4800d2891c6fa9376bb77d68be0304a6a457.json similarity index 54% rename from plane/.sqlx/query-c6ec316a814bac95629bb4af740898e538a03f4378f262c8849392ff57b9e22a.json rename to plane/.sqlx/query-41e963830001f529faec7d02e28f4800d2891c6fa9376bb77d68be0304a6a457.json index f00770cf6..9c56a8855 100644 --- a/plane/.sqlx/query-c6ec316a814bac95629bb4af740898e538a03f4378f262c8849392ff57b9e22a.json +++ b/plane/.sqlx/query-41e963830001f529faec7d02e28f4800d2891c6fa9376bb77d68be0304a6a457.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n update backend\n set\n last_keepalive = now()\n where id = $1\n ", + "query": "\n update backend\n set\n last_keepalive = now()\n where id = $1 and last_status != 'terminated'\n ", "describe": { "columns": [], "parameters": { @@ -10,5 +10,5 @@ }, "nullable": [] }, - "hash": "c6ec316a814bac95629bb4af740898e538a03f4378f262c8849392ff57b9e22a" + "hash": "41e963830001f529faec7d02e28f4800d2891c6fa9376bb77d68be0304a6a457" } diff --git a/plane/src/database/backend.rs b/plane/src/database/backend.rs index a65860236..92454e0d0 100644 --- a/plane/src/database/backend.rs +++ b/plane/src/database/backend.rs @@ -457,7 +457,7 @@ impl<'a> BackendDatabase<'a> { update backend set last_keepalive = now() - where id = $1 + where id = $1 and last_status != 'terminated' "#, backend_id.to_string(), ) diff --git a/plane/src/drone/runtime/docker/metrics.rs b/plane/src/drone/runtime/docker/metrics.rs index 549b1877b..b59d4454e 100644 --- a/plane/src/drone/runtime/docker/metrics.rs +++ b/plane/src/drone/runtime/docker/metrics.rs @@ -6,7 +6,7 @@ use std::sync::{Arc, Mutex}; use tokio::time::{Duration, Instant}; use tokio_stream::StreamExt; -const METRICS_INTERVAL: Duration = Duration::from_secs(5); +const METRICS_INTERVAL: Duration = Duration::from_secs(10); fn stream_metrics( docker: &Docker, diff --git a/plane/src/heartbeat_consts.rs b/plane/src/heartbeat_consts.rs index b992e33e1..977bc64e1 100644 --- a/plane/src/heartbeat_consts.rs +++ b/plane/src/heartbeat_consts.rs @@ -15,7 +15,7 @@ use std::time::Duration; /// How often the drone should emit a heartbeat. -pub const HEARTBEAT_INTERVAL: Duration = Duration::from_secs(5); +pub const HEARTBEAT_INTERVAL: Duration = Duration::from_secs(7); /// If we have not heard from a drone in this many seconds, /// we will consider it unhealthy. This means that we will