firebase-tools: 7.15.0 & 7.15.1
Platform: macOS 18.7.0 Darwin Kernel Version 18.7.0:
export const pubsubScheduled = functions.pubsub
.schedule('every 1 minutes')
.onRun(context => {
console.log('Resource', JSON.stringify(context.resource));
return true;
});
firebase emulators firebase emulators:start
✔ functions[pubsubScheduled]: pubsub function initialized.
Logging every 1 minute in the console
No output
Links:
https://github.com/firebase/firebase-tools/commit/b6fa88aa166bddc8969cbed7bd3b35392e307dd5
https://github.com/firebase/firebase-tools/commit/4dc64dac1d54f9e863fa2a99769bca447320940f
https://github.com/firebase/firebase-tools/pull/1543#issuecomment-600763141
@Elyx0 I think we maybe misled with how we represented https://github.com/firebase/firebase-tools/pull/2011
It lets those functions be loaded into the emulator but doesn't actually trigger them on a schedule. Instead you'd have to manually trigger them using a Pub/Sub message.
This was mostly meant for use within functions:shell but I can definitely see how this is confusing and we need to clarify it.
Thanks for clarifying @samtstern I'll wrap them in a setInterval in the global scope if it detects the emulator
Most helpful comment
@Elyx0 I think we maybe misled with how we represented https://github.com/firebase/firebase-tools/pull/2011
It lets those functions be loaded into the emulator but doesn't actually trigger them on a schedule. Instead you'd have to manually trigger them using a Pub/Sub message.
This was mostly meant for use within
functions:shellbut I can definitely see how this is confusing and we need to clarify it.