How to make a worker call itself and verify that the call came from that same worker
Hello!
Sometimes I have to run quite big functions that take longer than 10 ms of CPU time. That's why I was wondering if it's possible for a worker to call itself to "split" the request in a few smaller request (that would fix the CPU time issue right?).
I guess it is possible with service bindings (can I bind a worker to itself?) but is it possible to make sure that the request came from the same worker? I wouldn't want someone to find the URL and be able to call the parts of the functions...
2 Replies
You can add a header with a secret, then check if the requests have the secret.
If you're on the paid plan you can also switched to bundled to get up to 30 seconds of CPU time
Oh right, thank you! 🙂