Repository: unionlabs/union
File: hubble/src/main.rs (Rust)

Code before:
        });
    });

    let indexers = args.indexers.clone();

    let client_updates = {
        let db = db.clone();
        async move {
            let mut interval = tokio::time::interval(Duration::from_secs(10 * 60));

            loop {
                info!("fetching new client counterparty_chain_ids");
                chain_id_query::tx(db.clone(), indexers.clone()).await;
                interval.tick().await;
            }
        }
    };

    set.spawn(client_updates);

    let tokens_updates = async move {
        let mut interval = tokio::time::interval(Duration::from_secs(10 * 60));
        interval.tick().await;
        loop {
            info!("updating_tokens");
            let _ = token_list::update_tokens(db.clone(), args.tokens_urls.clone()).await;
            interval.tick().await;
        }
    };

    set.spawn(tokens_updates);

    while let Some(res) = set.join_next().await {
        match res {
            Ok(Err(err)) => {
                error!(
                    "encountered error while indexing: {:?}. shutting down.",
                    err
                );
                info!("shutdown - setting unhealthy");
                healthz::set_unhealthy();
                info!("shutdown - shutting down");
                let shutdown_hook = set.shutdown();
                info!("shutdown - awaiting shutdown");
                shutdown_hook.await;
                info!("shutdown - returning");
                return Err(err);
            }
            Err(err) => return Err(err.into()),
            Ok(Ok(_)) => {
                info!("indexer exited gracefully");

Review comment (suggestion):
```suggestion
            token_list::update_tokens(db.clone(), args.tokens_urls.clone()).await;
```

Code after:
        });
    });

    let indexers = args.indexers.clone();

    let client_updates = {
        let db = db.clone();
        async move {
            let mut interval = tokio::time::interval(Duration::from_secs(10 * 60));

            loop {
                info!("fetching new client counterparty_chain_ids");
                chain_id_query::tx(db.clone(), indexers.clone()).await;
                interval.tick().await;
            }
        }
    };

    set.spawn(client_updates);

    let tokens_updates = async move {
        let mut interval = tokio::time::interval(Duration::from_secs(10 * 60));
        interval.tick().await;
        loop {
            info!("updating_tokens");
            token_list::update_tokens(db.clone(), args.tokens_urls.clone()).await?;
            interval.tick().await;
        }
    };

    set.spawn(tokens_updates);

    while let Some(res) = set.join_next().await {
        match res {
            Ok(Err(err)) => {
                error!(
                    "encountered error while indexing: {:?}. shutting down.",
                    err
                );
                info!("shutdown - setting unhealthy");
                healthz::set_unhealthy();
                info!("shutdown - shutting down");
                let shutdown_hook = set.shutdown();
                info!("shutdown - awaiting shutdown");
                shutdown_hook.await;
                info!("shutdown - returning");
                return Err(err);
            }
            Err(err) => return Err(err.into()),
            Ok(Ok(_)) => {
                info!("indexer exited gracefully");