i tried following this guide from this answer https://stackoverflow.com/a/51909724/11833020, To execute a cron job with firebase realtime database on https://cron-job.org/ but it just fails everytime.
I'm getting a error that goes like this "Location: https://accounts.google.com/ServiceLogin?service=ah&passive=true&continue=https://appengine.google.com/_ah/conflogin%3Fcontinue%3Dhttp..."
Does cron jobs with realtime database also needs a blaze plan or what?
EDITED: Ok according to @DougStevenson answer i went and double check everything and there was a small error in the index.js and i fixed it and everything executed fine from cloud functions log and but nothing gets deleted from the database, I just changed the code from the above link to suit my database structure e.g :
exports.removeOldMessages = functions.https.onRequest((req, res) => {
const timeNow = Date.now();
const messagesRef = admin.database().ref('/messages/{user_id}/{passed_id}');
messagesRef.once('value', (snapshot) => {
snapshot.forEach((child) => {
if ((Number(child.val()['time']) + Number(child.val()['duration'])) <= timeNow) {
child.ref.set(null);
}
});
});
return res.status(200).end();
});
As you can see from the image this is how my database is structured, is that not how my code must look like in the index.js?
https://i.stack.imgur.com/l2Qgb.jpg
for the record i have zero programming knowledge in javascript i just read firebase docs on it, I'm just a beginner android developer any help or suggestions is welcomed. Thanks