feat: map RAILWAY_DEPLOYMENT_DRAINING_SECONDS to SHUTDOWN_TIMEOUT

This commit is contained in:
2025-09-13 00:36:11 -05:00
parent 9d720bb0a7
commit 77ab71d4d5

View File

@@ -1,3 +1,4 @@
use figment::value::UncasedStr;
use serenity::all::{ClientBuilder, GatewayIntents}; use serenity::all::{ClientBuilder, GatewayIntents};
use tokio::signal; use tokio::signal;
use tracing::{error, info, warn}; use tracing::{error, info, warn};
@@ -32,7 +33,13 @@ async fn main() {
// Load configuration first to get log level // Load configuration first to get log level
let config: Config = Figment::new() let config: Config = Figment::new()
.merge(Env::raw()) .merge(Env::raw().map(|k| {
if k == UncasedStr::new("RAILWAY_DEPLOYMENT_DRAINING_SECONDS") {
"SHUTDOWN_TIMEOUT".into()
} else {
k.into()
}
}))
.extract() .extract()
.expect("Failed to load config"); .expect("Failed to load config");