mirror of
https://github.com/Xevion/banner.git
synced 2025-12-10 08:06:35 -06:00
feat: map RAILWAY_DEPLOYMENT_DRAINING_SECONDS to SHUTDOWN_TIMEOUT
This commit is contained in:
@@ -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");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user