Cloud Functions with Firestore error “Deadline Exceeded”

前端 未结 1 995
余生分开走
余生分开走 2021-01-05 19:19

I\'m currently testing out the new firestore but I always get the same problem that it tells me something about Deadline exceeded



        
相关标签:
1条回答
  • 2021-01-05 19:55

    With Cloud Functions triggers, you need to return a promise that becomes resolved when the work is complete. The set() method on the document return a promise, so you should return it to let Cloud Functions know when it's safe to clean up the function:

    exports.registerUser = functions.auth.user().onCreate(event => {
      return admin.firestore().collection('users').doc(event.data.uid).set(...)
    });
    
    0 讨论(0)
提交回复
热议问题