Slack webhook for payout source threshold alerts (#4353)

* Slack webhook for payout alerts

* add PAYOUT_ALERT_SLACK_WEBHOOK to check_env_vars

* Fix commit

* Fix webhook format

* Add new env vars in .env.local

* Rename env vars, fire webhook on error

* Fix compilation

* Clippy

* Fix CI

* Add env vars to .env.docker-compose
This commit is contained in:
François-Xavier Talbot
2025-09-10 22:16:21 +01:00
committed by GitHub
parent af3b829449
commit 58aac642a9
11 changed files with 183 additions and 41 deletions

View File

@@ -1,6 +1,6 @@
use crate::database::redis::RedisPool;
use crate::queue::payouts::{
PayoutsQueue, insert_bank_balances, process_payout,
PayoutsQueue, insert_bank_balances_and_webhook, process_payout,
};
use crate::search::indexing::index_projects;
use crate::{database, search};
@@ -59,7 +59,7 @@ impl BackgroundTask {
pub async fn update_bank_balances(pool: sqlx::Pool<Postgres>) {
let payouts_queue = PayoutsQueue::new();
match insert_bank_balances(&payouts_queue, &pool).await {
match insert_bank_balances_and_webhook(&payouts_queue, &pool).await {
Ok(_) => info!("Bank balances updated successfully"),
Err(error) => error!(%error, "Bank balances update failed"),
}