Open deniss-y opened 4 years ago
You would need to re-watch that gmail at least every week.
The best way to comes to mind is to have a separate function that runs the following on a schedule ( cron).
const setUpGmailPushNotifications = (email, pubsubTopic) => {
const GCP_PROJECT = process.env.GCP_PROJECT;
return gmail.users.watch({
userId: email,
requestBody: {
labelIds: ["INBOX"],
topicName: `projects/${GCP_PROJECT}/topics/${pubsubTopic}`,
},
});
};
Hey guys! Thanks for great tutorial it was really helpful to me and works well, except one moment... cloud function stops working after 3-4 days. Could someone tell me what could be the reason of this?
Thanks in advance