Skip to content

Commit

Permalink
refactor: [#939] change config version
Browse files Browse the repository at this point in the history
The current config version is 2 leaving the previous before the config
averhaul as version 1.
  • Loading branch information
josecelano committed Jul 1, 2024
1 parent 5aad462 commit 2969df3
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions packages/configuration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! Torrust Tracker, which is a `BitTorrent` tracker server.
//!
//! The current version for configuration is [`v1`].
pub mod v1;
pub mod v2;

use std::collections::HashMap;
use std::env;
Expand Down Expand Up @@ -34,12 +34,12 @@ const ENV_VAR_CONFIG_TOML: &str = "TORRUST_TRACKER_CONFIG_TOML";
/// The `tracker.toml` file location.
pub const ENV_VAR_CONFIG_TOML_PATH: &str = "TORRUST_TRACKER_CONFIG_TOML_PATH";

pub type Configuration = v1::Configuration;
pub type Core = v1::core::Core;
pub type HealthCheckApi = v1::health_check_api::HealthCheckApi;
pub type HttpApi = v1::tracker_api::HttpApi;
pub type HttpTracker = v1::http_tracker::HttpTracker;
pub type UdpTracker = v1::udp_tracker::UdpTracker;
pub type Configuration = v2::Configuration;
pub type Core = v2::core::Core;
pub type HealthCheckApi = v2::health_check_api::HealthCheckApi;
pub type HttpApi = v2::tracker_api::HttpApi;
pub type HttpTracker = v2::http_tracker::HttpTracker;
pub type UdpTracker = v2::udp_tracker::UdpTracker;

pub type AccessTokens = HashMap<String, String>;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use serde::{Deserialize, Serialize};

use super::network::Network;
use crate::v1::database::Database;
use crate::v2::database::Database;
use crate::{AnnouncePolicy, TrackerPolicy};

#[allow(clippy::struct_excessive_bools)]
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ mod tests {

use std::net::{IpAddr, Ipv4Addr};

use crate::v1::Configuration;
use crate::v2::Configuration;
use crate::Info;

#[cfg(test)]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl HttpApi {

#[cfg(test)]
mod tests {
use crate::v1::tracker_api::HttpApi;
use crate::v2::tracker_api::HttpApi;

#[test]
fn http_api_configuration_should_check_if_it_contains_a_token() {
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/jobs/torrent_cleanup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::sync::Arc;

use chrono::Utc;
use tokio::task::JoinHandle;
use torrust_tracker_configuration::v1::core::Core;
use torrust_tracker_configuration::v2::core::Core;
use tracing::info;

use crate::core;
Expand Down

0 comments on commit 2969df3

Please sign in to comment.