Skip to content

Commit 16519cf

Browse files
committed
fix(poller): properly use args
1 parent 316d461 commit 16519cf

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

Diff for: src/sexurity-poller/src/main.rs

+13-8
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ struct Arguments {
3535

3636
#[arg(default_value = "false", long)]
3737
disable_hackactivity_polling: bool,
38-
39-
#[arg(default_value = "false", long)]
40-
disable_user_report_count_polling: bool,
4138
}
4239
fn main() {
4340
pretty_env_logger::init();
@@ -63,12 +60,20 @@ fn main() {
6360
redis_client: redis,
6461
};
6562

66-
// No error handling here so we don't check the result
67-
let _ = polls::reputation::run_poll(&config);
68-
let _ = polls::reports::run_poll(&config);
6963

70-
polls::reputation::start_poll_event_loop(&config);
71-
polls::reports::start_poll_event_loop(&config);
64+
// We don't check the result on the first call
65+
// since there's no error handling here
66+
67+
if !args.disable_reputation_polling {
68+
let _ = polls::reputation::run_poll(&config);
69+
polls::reputation::start_poll_event_loop(&config);
70+
}
71+
72+
if !args.disable_hackactivity_polling {
73+
let _ = polls::reports::run_poll(&config);
74+
polls::reports::start_poll_event_loop(&config);
75+
}
76+
7277

7378
// keep main thread alive
7479
loop {

0 commit comments

Comments
 (0)