Skip to content

Commit

Permalink
rsc: Finalize tool rename (#1482)
Browse files Browse the repository at this point in the history
  • Loading branch information
V-FEXrt authored Dec 4, 2023
1 parent 9238ebf commit 4fa5f88
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions rust/rsc/src/common/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ use config::{Config, ConfigError, Environment, File};
use serde::{Deserialize, Serialize};

#[derive(Debug, Deserialize, Default)]
pub struct GSCConfigOverride {
pub struct RSCConfigOverride {
pub config_override: Option<String>,
pub database_url: Option<String>,
pub server_addr: Option<String>,
}

#[derive(Debug, Deserialize, Serialize)]
pub struct GSCConfig {
pub struct RSCConfig {
pub database_url: String,
// TODO: We should allow setting a domain as well
pub server_addr: String,
}

impl GSCConfig {
pub fn new(overrides: GSCConfigOverride) -> Result<GSCConfig, ConfigError> {
impl RSCConfig {
pub fn new(overrides: RSCConfigOverride) -> Result<RSCConfig, ConfigError> {
// Gather the config
let config = Config::builder()
.add_source(Environment::with_prefix("WAKE_GSC"))
.add_source(Environment::with_prefix("WAKE_RSC"))
.add_source(
File::with_name(
&overrides
Expand Down
6 changes: 3 additions & 3 deletions rust/rsc/src/rsc/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let args = ServerOptions::parse();

// Get the configuration
let config = config::GSCConfig::new(config::GSCConfigOverride {
let config = config::RSCConfig::new(config::RSCConfigOverride {
config_override: args.config_override,
server_addr: args.server_addr,
database_url: args.database_url,
Expand All @@ -111,11 +111,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let err = Error::new(
ErrorKind::Other,
format!(
"This gsc version expects {:?} additional migrations to be applied",
"This rsc version expects {:?} additional migrations to be applied",
pending_migrations.len()
),
);
tracing::error! {%err, "unperformed migrations, please apply these migrations before starting gsc"};
tracing::error! {%err, "unperformed migrations, please apply these migrations before starting rsc"};
Err(err)?;
}
let state = Arc::new(connection);
Expand Down
6 changes: 3 additions & 3 deletions rust/rsc/src/rsc_tool/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let args = TopLevel::parse();

// Gather our config
let config = config::GSCConfig::new(config::GSCConfigOverride {
let config = config::RSCConfig::new(config::RSCConfigOverride {
config_override: args.config_override,
database_url: args.database_url,
..Default::default()
Expand All @@ -212,11 +212,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let err = Error::new(
ErrorKind::Other,
format!(
"This gsc-tool version expects {:?} additional migrations to be applied",
"This rsc-tool version expects {:?} additional migrations to be applied",
pending_migrations.len()
),
);
tracing::error! {%err, "unperformed migrations, please apply these migrations before using gsc-tool"};
tracing::error! {%err, "unperformed migrations, please apply these migrations before using rsc-tool"};
Err(err)?;
}

Expand Down

0 comments on commit 4fa5f88

Please sign in to comment.