|
@@ -43,6 +43,7 @@ pub struct Config {
|
|
|
extra_infos_base_url: String,
|
|
|
//require_bridge_token: bool,
|
|
|
port: u16,
|
|
|
+ updater_schedule: String,
|
|
|
}
|
|
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
@@ -135,13 +136,6 @@ enum Command {
|
|
|
|
|
|
#[tokio::main]
|
|
|
async fn main() {
|
|
|
- // TODO: Currently, we're processing extra-infos here, but we want to:
|
|
|
- // 2. Periodically (daily):
|
|
|
- // a) download new extra-infos
|
|
|
- // b) determine whether we think each bridge is blocked or not
|
|
|
- // c) report these results to the LA
|
|
|
- // 3. Store all our data
|
|
|
-
|
|
|
let args: Args = Args::parse();
|
|
|
|
|
|
let config: Config = serde_json::from_reader(BufReader::new(
|
|
@@ -178,7 +172,7 @@ async fn main() {
|
|
|
let updater = spawn(async move {
|
|
|
// Run updater once per day
|
|
|
let mut sched = Scheduler::utc();
|
|
|
- sched.add(Job::new("* * 22 * * * *", move || {
|
|
|
+ sched.add(Job::new(config.updater_schedule, move || {
|
|
|
run_updater(updater_tx.clone())
|
|
|
}));
|
|
|
});
|