setInterval on firebase instead of using cron -


i making spam counter ( on firebase ). use database trigger on firebase cloud functions increment path (/counter/${uid}). path hold integer each user other path have security rule reference , check whether exceed limit. however, clear counter once day.

when search on google found official way of firebase using google cloud service deploy cron job. however, wonder if use setinterval on cloud function instead work. task 1 line execution ( admin.database().ref('/counter').set({}) . , not serious if skip once or twice of execution due problem, should ok.

thanks

the use of setinterval won't work, , it's not ever recommended so. can use setinterval keep function alive amount of time, paying time if function waiting. still subject way cloud functions time out function (default 60 seconds, max 9 minutes special configuration).


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -