title: Firebase functions - Loop promises timeout
body: <p>I'm trying to loop on an array of <code>ids</code> to store async <code>promises</code> :</p>
  
  <pre><code>const getTokens = [];
  
  for (const uid of uids) {
      const promise = await admin.database()
          .ref(`/tokens`)
          .orderByChild('uid')
          .equalTo(uid)
          .once('child_added');
  
      getTokens.push(promise);
  }
  
  const results = await Promise.all(getTokens);
  </code></pre>
  
  <p>But I always get the following error on the first assignment to <code>promise</code> const : </p>
  
  <blockquote>
    <p>Function execution took 60002 ms, finished with status: 'timeout'.</p>
  </blockquote>
  
  <p>I heard about a Firebase SDK issue that could be fixed with this workaround :</p>
  
  <pre><code>...
  const promise = await admin.database()
      .ref(`/tokens`)
      .orderByChild('uid')
      .equalTo(uid)
      .once('child_added').then(() =&gt; { console.log('Promise added.' });
  ...
  </code></pre>
  
  <p>But in my case, I still got the same issue.</p>