Skip to content

Commit

Permalink
Move brain_location to an env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
foursixnine committed Dec 30, 2024
1 parent 6e4ed2a commit 0d4b058
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions telegram/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,9 @@ type MyDialogue = Dialogue<State, InMemStorage<State>>;
type HandlerResult = Result<(), Box<dyn std::error::Error + Send + Sync>>;

// this should be an env variable that can be set on runtime.
fn get_brain_location() -> &'static String {
fn get_brain_location() -> String {
match std::env::var("BRAIN_LOCATION") {
Ok(location) => {
let brain_location: String;
brain_location = location;
log::info!("Brain location is: {}", &brain_location);
&brain_location
}
Ok(location) => location,
Err(_) => panic!("Please set the BRAIN_LOCATION environment variable"),
}
}
Expand Down

0 comments on commit 0d4b058

Please sign in to comment.