Skip to content

Commit

Permalink
refactor: change ttls default values
Browse files Browse the repository at this point in the history
  • Loading branch information
sagojez committed Jun 7, 2024
1 parent 249acde commit 07ba713
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions integrationos-api/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,20 @@ pub struct Config {
#[envconfig(from = "CACHE_SIZE", default = "100")]
pub cache_size: u64,
#[envconfig(from = "ACCESS_KEY_CACHE_TTL_SECS", default = "1800")]
// Half hour access key ttl by default
pub access_key_cache_ttl_secs: u64,
#[envconfig(from = "ACCESS_KEY_WHITELIST_REFRESH_INTERVAL_SECS", default = "60")]
pub access_key_whitelist_refresh_interval_secs: u64,
#[envconfig(from = "CONNECTION_CACHE_TTL_SECS", default = "120")]
pub connection_cache_ttl_secs: u64,
#[envconfig(from = "ENGINEERING_ACCOUNT_ID", default = "engineering_account")]
pub engineering_account_id: String,
#[envconfig(from = "CONNECTION_DEFINITION_CACHE_TTL_SECS", default = "120")]
#[envconfig(from = "CONNECTION_DEFINITION_CACHE_TTL_SECS", default = "86400")]
pub connection_definition_cache_ttl_secs: u64,
#[envconfig(from = "CONNECTION_OAUTH_DEFINITION_CACHE_TTL_SECS", default = "120")]
#[envconfig(from = "CONNECTION_OAUTH_DEFINITION_CACHE_TTL_SECS", default = "86400")]
pub connection_oauth_definition_cache_ttl_secs: u64,
#[envconfig(from = "CONNECTION_MODEL_SCHEMA_TTL_SECS", default = "3600")]
#[envconfig(from = "CONNECTION_MODEL_SCHEMA_TTL_SECS", default = "86400")]
pub connection_model_schema_cache_ttl_secs: u64,
#[envconfig(from = "CONNECTION_MODEL_DEFINITION_CACHE_TTL_SECS", default = "3600")]
#[envconfig(from = "CONNECTION_MODEL_DEFINITION_CACHE_TTL_SECS", default = "86400")]
pub connection_model_definition_cache_ttl_secs: u64,
#[envconfig(from = "SECRET_CACHE_TTL_SECS", default = "300")]
pub secret_cache_ttl_secs: u64,
Expand Down
3 changes: 1 addition & 2 deletions integrationos-api/src/endpoints/unified.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use super::{get_connection, INTEGRATION_OS_PASSTHROUGH_HEADER};
use crate::{config::Headers, metrics::Metric, server::AppState};
use axum::{
extract::{Path, Query, State},
Expand All @@ -21,8 +22,6 @@ use serde_json::{json, Value};
use std::{collections::HashMap, sync::Arc};
use tracing::error;

use super::{get_connection, INTEGRATION_OS_PASSTHROUGH_HEADER};

pub fn get_router() -> Router<Arc<AppState>> {
Router::new()
.route("/:model/:id", get(get_request))
Expand Down
6 changes: 3 additions & 3 deletions integrationos-event/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ pub struct EventCoreConfig {
pub cache: CacheConfig,
#[envconfig(nested = true)]
pub db: DatabaseConfig,
#[envconfig(from = "CONNECTION_CACHE_TTL_SECS", default = "3600")]
#[envconfig(from = "CONNECTION_CACHE_TTL_SECS", default = "86400")]
pub connection_cache_ttl_secs: u64,
#[envconfig(from = "CONNECTION_MODEL_SCHEMA_TTL_SECS", default = "3600")]
#[envconfig(from = "CONNECTION_MODEL_SCHEMA_TTL_SECS", default = "86400")]
pub connection_model_schema_cache_ttl_secs: u64,
#[envconfig(from = "CONNECTION_MODEL_DEFINITION_CACHE_TTL_SECS", default = "3600")]
#[envconfig(from = "CONNECTION_MODEL_DEFINITION_CACHE_TTL_SECS", default = "86400")]
pub connection_model_definition_cache_ttl_secs: u64,
#[envconfig(from = "SECRET_CACHE_TTL_SECS", default = "300")]
pub secret_cache_ttl_secs: u64,
Expand Down

0 comments on commit 07ba713

Please sign in to comment.