mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-22 08:02:19 +00:00
feat: failed key renewal alert + renew on start if no recent renewal (#4387)
* feat: failed key renewal alert + renew on start if no recent renewal * Update ee-repo-ref.txt
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "SELECT EXISTS(SELECT 1 FROM metrics WHERE id = 'license_key_renewal' AND created_at > NOW() - INTERVAL '24 hours')",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
"ordinal": 0,
|
||||
"name": "exists",
|
||||
"type_info": "Bool"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"Left": []
|
||||
},
|
||||
"nullable": [
|
||||
null
|
||||
]
|
||||
},
|
||||
"hash": "388b3705f641621b0c2f4496e36cb7aa5a75b7e40fa312eff6590e54b02635a2"
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
636634202618e4b6a7fd20117d811f15cfbf9311
|
||||
534f50aae2f89281304b3c3ba943d18afc07fad4
|
||||
@@ -1045,7 +1045,7 @@ pub async fn monitor_db(
|
||||
|
||||
let worker_groups_alerts_f = async {
|
||||
#[cfg(feature = "enterprise")]
|
||||
if server_mode {
|
||||
if server_mode && !initial_load {
|
||||
worker_groups_alerts(&db).await;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -355,7 +355,7 @@ pub async fn renew_license_key(
|
||||
) -> Result<String> {
|
||||
require_super_admin(&db, &authed.email).await?;
|
||||
windmill_common::stats_ee::send_stats(&"manual".to_string(), &HTTP_CLIENT, &db).await?;
|
||||
let result = windmill_common::ee::renew_license_key(&HTTP_CLIENT, &db, license_key).await;
|
||||
let result = windmill_common::ee::renew_license_key(&HTTP_CLIENT, &db, license_key, true).await;
|
||||
|
||||
if result != "success" {
|
||||
return Err(error::Error::BadRequest(format!(
|
||||
|
||||
@@ -48,6 +48,7 @@ pub async fn renew_license_key(
|
||||
_http_client: &reqwest::Client,
|
||||
_db: &crate::db::DB,
|
||||
_key: Option<String>,
|
||||
_manual: bool,
|
||||
) -> String {
|
||||
// Implementation is not open source
|
||||
"".to_string()
|
||||
|
||||
@@ -40,6 +40,8 @@ use std::{
|
||||
},
|
||||
time::Duration,
|
||||
};
|
||||
#[cfg(feature = "benchmark")]
|
||||
use std::sync::atomic::AtomicUsize;
|
||||
|
||||
#[cfg(feature = "benchmark")]
|
||||
use std::sync::atomic::AtomicUsize;
|
||||
|
||||
Reference in New Issue
Block a user