XFFXFF commited on
Commit
9773cee
1 Parent(s): 0527288

change the 'aggregator' option to 'production_use'

Browse files
Files changed (2) hide show
  1. src/config_parser/parser.rs +11 -4
  2. websurfx/config.lua +3 -4
src/config_parser/parser.rs CHANGED
@@ -49,7 +49,16 @@ impl Config {
49
  .load(&fs::read_to_string("./websurfx/config.lua")?)
50
  .exec()?;
51
 
52
- let aggregator_config = globals.get::<_, rlua::Table>("aggregator")?;
 
 
 
 
 
 
 
 
 
53
 
54
  Ok(Config {
55
  port: globals.get::<_, u16>("port")?,
@@ -59,9 +68,7 @@ impl Config {
59
  globals.get::<_, String>("colorscheme")?,
60
  ),
61
  redis_connection_url: globals.get::<_, String>("redis_connection_url")?,
62
- aggregator: AggreatorConfig {
63
- random_delay: aggregator_config.get::<_, bool>("random_delay")?,
64
- },
65
  })
66
  })
67
  }
 
49
  .load(&fs::read_to_string("./websurfx/config.lua")?)
50
  .exec()?;
51
 
52
+ let production_use = globals.get::<_, bool>("production_use")?;
53
+ let aggregator_config = if production_use {
54
+ AggreatorConfig {
55
+ random_delay: true,
56
+ }
57
+ } else {
58
+ AggreatorConfig {
59
+ random_delay: false,
60
+ }
61
+ };
62
 
63
  Ok(Config {
64
  port: globals.get::<_, u16>("port")?,
 
68
  globals.get::<_, String>("colorscheme")?,
69
  ),
70
  redis_connection_url: globals.get::<_, String>("redis_connection_url")?,
71
+ aggregator: aggregator_config
 
 
72
  })
73
  })
74
  }
websurfx/config.lua CHANGED
@@ -20,7 +20,6 @@ theme = "simple" -- the theme name which should be used for the website
20
  -- Caching
21
  redis_connection_url = "redis://127.0.0.1:8082" -- redis connection url address on which the client should connect on.
22
 
23
- -- Aggregator
24
- aggregator = {
25
- random_delay = false, -- whether to add random delay before sending the request to the search engine
26
- }
 
20
  -- Caching
21
  redis_connection_url = "redis://127.0.0.1:8082" -- redis connection url address on which the client should connect on.
22
 
23
+ production_use = false -- whether to use production mode or not
24
+ -- if production_use is set to true
25
+ -- 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