mirror of
https://github.com/Xevion/banner.git
synced 2025-12-06 01:14:22 -06:00
chore: set banner URL default in config, remove old mentions of redis
This commit is contained in:
@@ -5,7 +5,6 @@
|
|||||||
//! This module provides functionality to:
|
//! This module provides functionality to:
|
||||||
//! - Search for courses and retrieve course information
|
//! - Search for courses and retrieve course information
|
||||||
//! - Manage Banner API sessions and authentication
|
//! - Manage Banner API sessions and authentication
|
||||||
//! - Scrape course data and cache it in Redis
|
|
||||||
//! - Generate ICS files and calendar links
|
//! - Generate ICS files and calendar links
|
||||||
|
|
||||||
pub mod api;
|
pub mod api;
|
||||||
@@ -14,8 +13,8 @@ pub mod json;
|
|||||||
pub mod middleware;
|
pub mod middleware;
|
||||||
pub mod models;
|
pub mod models;
|
||||||
pub mod query;
|
pub mod query;
|
||||||
pub mod rate_limiter;
|
|
||||||
pub mod rate_limit_middleware;
|
pub mod rate_limit_middleware;
|
||||||
|
pub mod rate_limiter;
|
||||||
pub mod session;
|
pub mod session;
|
||||||
pub mod util;
|
pub mod util;
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ pub async fn get_course_by_crn(ctx: &Context<'_>, crn: i32) -> Result<Course> {
|
|||||||
let current_term_status = Term::get_current();
|
let current_term_status = Term::get_current();
|
||||||
let term = current_term_status.inner();
|
let term = current_term_status.inner();
|
||||||
|
|
||||||
// Fetch live course data from Redis cache via AppState
|
// Fetch live course data from database via AppState
|
||||||
app_state
|
app_state
|
||||||
.get_course_or_fetch(&term.to_string(), &crn.to_string())
|
.get_course_or_fetch(&term.to_string(), &crn.to_string())
|
||||||
.await
|
.await
|
||||||
|
|||||||
@@ -40,6 +40,9 @@ pub struct Config {
|
|||||||
pub bot_target_guild: u64,
|
pub bot_target_guild: u64,
|
||||||
|
|
||||||
/// Base URL for banner generation service
|
/// Base URL for banner generation service
|
||||||
|
///
|
||||||
|
/// Defaults to "https://ssbprod.utsa.edu/StudentRegistrationSsb/ssb" if not specified
|
||||||
|
#[serde(default = "default_banner_base_url")]
|
||||||
pub banner_base_url: String,
|
pub banner_base_url: String,
|
||||||
/// Rate limiting configuration for Banner API requests
|
/// Rate limiting configuration for Banner API requests
|
||||||
#[serde(default = "default_rate_limiting")]
|
#[serde(default = "default_rate_limiting")]
|
||||||
@@ -61,6 +64,11 @@ fn default_shutdown_timeout() -> Duration {
|
|||||||
Duration::from_secs(8)
|
Duration::from_secs(8)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Default banner base URL
|
||||||
|
fn default_banner_base_url() -> String {
|
||||||
|
"https://ssbprod.utsa.edu/StudentRegistrationSsb/ssb".to_string()
|
||||||
|
}
|
||||||
|
|
||||||
/// Rate limiting configuration for Banner API requests
|
/// Rate limiting configuration for Banner API requests
|
||||||
#[derive(Deserialize, Clone, Debug)]
|
#[derive(Deserialize, Clone, Debug)]
|
||||||
pub struct RateLimitingConfig {
|
pub struct RateLimitingConfig {
|
||||||
|
|||||||
Reference in New Issue
Block a user