fix: prevent duplicate worker alerts (#4309)

This commit is contained in:
HugoCasa
2024-08-31 13:27:59 +02:00
committed by GitHub
parent 03ec37a956
commit 8e30928a78
5 changed files with 45 additions and 29 deletions
@@ -1,14 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO healthchecks (check_type, healthy) \n VALUES ('min_alive_workers_' || $1, false)",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text"
]
},
"nullable": []
},
"hash": "3aa1ca29c751f13ea1249c7d43c8b2ce70503935645973fb6a5b35ec47ad1c4c"
}
@@ -0,0 +1,22 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO healthchecks (check_type, healthy) \n SELECT 'min_alive_workers_' || $1, true \n WHERE NOT EXISTS (\n SELECT 1 FROM healthchecks \n WHERE check_type = 'min_alive_workers_' || $1 AND created_at > NOW() - INTERVAL '2 minutes'\n )\n RETURNING id",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int8"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false
]
},
"hash": "4cfa57b2a836242d55071ef237855b21bbc487b80bda7fd6250ac12e93938577"
}
@@ -0,0 +1,22 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO healthchecks (check_type, healthy) \n SELECT 'min_alive_workers_' || $1, false\n WHERE NOT EXISTS (\n SELECT 1 FROM healthchecks \n WHERE check_type = 'min_alive_workers_' || $1 AND created_at > NOW() - INTERVAL '2 minutes'\n )\n RETURNING id",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int8"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false
]
},
"hash": "5f22a7c9170f035779782591b4bfb1d462d5c796f08c7481c42154f9bfacf388"
}
@@ -1,14 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO healthchecks (check_type, healthy) VALUES ('min_alive_workers_' || $1, true)",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text"
]
},
"nullable": []
},
"hash": "b140388b2e31d15ab4b3a348b6aeec3da9216d4eee23d81fdf6ade95cb7aa1ef"
}
+1 -1
View File
@@ -1 +1 @@
b86b52e5d1ed2a67ee89c5924e333a28da8b76ca
04a34e95a377afdc45cf4f354d5009f02260f3b1