-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add region
field to balancer protocol
#1124
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,7 @@ pub enum MsgM2B { | |
pub struct M2BInit { | ||
/// The port that the monolith is listening for HTTP requests on. | ||
pub port: u16, | ||
pub region: String, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. line 99? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file won't let me comment on individual lines so: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wss is a
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -360,6 +360,12 @@ export const conf = convict({ | |
default: 3002, | ||
env: "BALANCING_PORT", | ||
}, | ||
region: { | ||
doc: "The region that this server is in.", | ||
format: String, | ||
default: "unknown", | ||
env: "BALANCING_REGION", | ||
}, | ||
}, | ||
mail: { | ||
enabled: { | ||
|
@@ -513,6 +519,11 @@ function postProcessConfig(): void { | |
if (conf.get("mail.enabled")) { | ||
validateMail(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does mail mean in this context? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. email. used for password recovery emails. |
||
} | ||
|
||
if (process.env.FLY_REGION) { | ||
log.info("Found FLY_REGION. Using it for balancing.region."); | ||
conf.set("balancing.region", process.env.FLY_REGION); | ||
} | ||
} | ||
|
||
function validateMail() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does .into() do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It comes from the
Into
trait. https://doc.rust-lang.org/std/convert/trait.Into.htmlYou can read more in depth about
From
/Into
here: https://practice.rs/type-conversions/from-into.html Specifically, thisinto()
converts a&'static str
into aString
.