From 178ca616d1f79705ab3a90b4a236b9e742b83261 Mon Sep 17 00:00:00 2001 From: Gabriel Simmer Date: Thu, 20 Jun 2024 20:48:50 +0100 Subject: [PATCH] Parameterize the redis url --- flake.nix | 3 +-- src/main.rs | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 15cede0..4175e7e 100644 --- a/flake.nix +++ b/flake.nix @@ -49,7 +49,6 @@ config = { Cmd = [ "${my-crate}/bin/duplikate" ]; }; - architecture = system; }; in { @@ -74,7 +73,7 @@ docker push $amd64 docker push $arm64 docker manifest create --amend git.gmem.ca/arch/duplikate:latest $arm64 $amd64 - docker manifest push git.gmem.ca/arch/duplikate:latest + docker manifest push git.gmem.ca/arch/duplikate:latest --purge ''); }; diff --git a/src/main.rs b/src/main.rs index cf2220a..12def95 100644 --- a/src/main.rs +++ b/src/main.rs @@ -155,14 +155,14 @@ impl EventHandler for Handler { #[tokio::main] async fn main() { dotenv().ok(); - // Login with a bot token from the environment + let redis_url = env::var("REDIS_URL").expect("Expected a Redis instance URL"); let token = env::var("DISCORD_TOKEN").expect("Expected a token in the environment"); // Set gateway intents, which decides what events the bot will be notified about let intents = GatewayIntents::GUILD_MESSAGES | GatewayIntents::DIRECT_MESSAGES | GatewayIntents::MESSAGE_CONTENT; - let client = redis::Client::open("redis://127.0.0.1/").unwrap(); + let client = redis::Client::open(redis_url).unwrap(); let handler = Handler { redis: client }; // Create a new instance of the Client, logging in as a bot.