# Making canister call results in request timed out

**URL:** <https://forum.dfinity.org/t/making-canister-call-results-in-request-timed-out/37848>\
**Category:** Rust\
**Created:** [November 26, 2024, 4:19pm UTC](https://forum.dfinity.org/t/making-canister-call-results-in-request-timed-out/37848 "2024-11-26T16:19:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Buriburizaemon](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/buriburizaemon/32/19925_2.png) [@Buriburizaemon](https://forum.dfinity.org/u/Buriburizaemon)\
**Post date:** [November 26, 2024, 4:19pm UTC](https://forum.dfinity.org/t/making-canister-call-results-in-request-timed-out/37848/1 "2024-11-26T16:19:26Z")

</div>

My setup consist of 2 two canisters. `backend` and `ord-indexer`.

`ord-indexer` is responsible for filtering and storing utxos.

when I need to check for balance,  
I need to run a loop over the utxos owned by the user’s address. then a call is made to `ord-canister`, if the utxos contains rune.

I’m confused what’s happening. The call passes sometimes but it fails too.  
I’m getting request timed out error.

Making loop of inter-canister calls shouldn’t be a problem, right?

there is a timer running on `ord-indexer`.

```rs
pub fn sync(secs: u64) {
    ic_cdk_timers::set_timer(std::time::Duration::from_secs(secs), || {
        ic_cdk::spawn(async move {
            let (height, current) = crate::highest_block();
            match get_best_from_rpc().await {
                Ok((best, _)) => {
                    if height + REQUIRED_CONFIRMATIONS >= best {
                        sync(120);
                    } else {
                    match updater::get_block(height + 1).await {
                        Ok(block) => {
                            if block.header.prev_blockhash != current {
                                sync(300);
                                return;
                            }
                            if let Err(e) = updater::index_block(height + 1, block).await {
                                sync(3);
                            }
                            Err(e) => {
                                sync(5);
                            }
                        }
                    }}
                Err(e) => {
                    sync(5);
                }
            }
        });
    });
}

```

Is this timer causing the problem?

---

<div class="post-metadata">

**Author:** ![Buriburizaemon](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/buriburizaemon/32/19925_2.png) [@Buriburizaemon](https://forum.dfinity.org/u/Buriburizaemon)\
**Post date:** [November 26, 2024, 10:11pm UTC](https://forum.dfinity.org/t/making-canister-call-results-in-request-timed-out/37848/2 "2024-11-26T22:11:49Z")

</div>

my problem was caused due to confusion with nested loops.

the problem is fixed!
