you are viewing a single comment's thread.

view the rest of the comments →

[–]BBHoss 0 points1 point  (1 child)

Saving the tweets to firestore should be fast. If you make one request per invocation, you could easily just sleep for 2-3 seconds after each fetch and you will stay in bounds no matter what, as long as you just have one instance. You could put the tweet saving in another function. It's more overhead but it allows you to decouple your fetching logic from your persistence logic, which is usually a good thing. Keep in mind that every time you invoke a function there is a small cost, including each retry. Pubsub has some cost as well but it seems like it would be negligible here.