mirror of
https://github.com/neon-mmd/websurfx.git
synced 2024-11-25 15:38:21 -05:00
change the 'aggregator' option to 'production_use'
This commit is contained in:
parent
05272884ba
commit
9773cee38d
@ -49,7 +49,16 @@ impl Config {
|
|||||||
.load(&fs::read_to_string("./websurfx/config.lua")?)
|
.load(&fs::read_to_string("./websurfx/config.lua")?)
|
||||||
.exec()?;
|
.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 {
|
Ok(Config {
|
||||||
port: globals.get::<_, u16>("port")?,
|
port: globals.get::<_, u16>("port")?,
|
||||||
@ -59,9 +68,7 @@ impl Config {
|
|||||||
globals.get::<_, String>("colorscheme")?,
|
globals.get::<_, String>("colorscheme")?,
|
||||||
),
|
),
|
||||||
redis_connection_url: globals.get::<_, String>("redis_connection_url")?,
|
redis_connection_url: globals.get::<_, String>("redis_connection_url")?,
|
||||||
aggregator: AggreatorConfig {
|
aggregator: aggregator_config
|
||||||
random_delay: aggregator_config.get::<_, bool>("random_delay")?,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@ theme = "simple" -- the theme name which should be used for the website
|
|||||||
-- Caching
|
-- Caching
|
||||||
redis_connection_url = "redis://127.0.0.1:8082" -- redis connection url address on which the client should connect on.
|
redis_connection_url = "redis://127.0.0.1:8082" -- redis connection url address on which the client should connect on.
|
||||||
|
|
||||||
-- Aggregator
|
production_use = false -- whether to use production mode or not
|
||||||
aggregator = {
|
-- if production_use is set to true
|
||||||
random_delay = false, -- whether to add random delay before sending the request to the search engine
|
-- 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
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user