0
0
mirror of https://github.com/neon-mmd/websurfx.git synced 2024-12-22 12:28:21 -05:00

change the 'aggregator' option to 'production_use'

This commit is contained in:
XFFXFF 2023-05-23 00:56:44 +00:00
parent 05272884ba
commit 9773cee38d
2 changed files with 14 additions and 8 deletions

View File

@ -49,7 +49,16 @@ impl Config {
.load(&fs::read_to_string("./websurfx/config.lua")?)
.exec()?;
let aggregator_config = globals.get::<_, rlua::Table>("aggregator")?;
let production_use = globals.get::<_, bool>("production_use")?;
let aggregator_config = if production_use {
AggreatorConfig {
random_delay: true,
}
} else {
AggreatorConfig {
random_delay: false,
}
};
Ok(Config {
port: globals.get::<_, u16>("port")?,
@ -59,9 +68,7 @@ impl Config {
globals.get::<_, String>("colorscheme")?,
),
redis_connection_url: globals.get::<_, String>("redis_connection_url")?,
aggregator: AggreatorConfig {
random_delay: aggregator_config.get::<_, bool>("random_delay")?,
},
aggregator: aggregator_config
})
})
}

View File

@ -20,7 +20,6 @@ theme = "simple" -- the theme name which should be used for the website
-- Caching
redis_connection_url = "redis://127.0.0.1:8082" -- redis connection url address on which the client should connect on.
-- Aggregator
aggregator = {
random_delay = false, -- whether to add random delay before sending the request to the search engine
}
production_use = false -- whether to use production mode or not
-- if production_use is set to true
-- there will be a random delay before sending the request to the search engines, this is to prevent the search engines from blocking the ip address