-
Notifications
You must be signed in to change notification settings - Fork 15
feat: add worker tracking and graceful shutdown for edge functions #513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add worker tracking and graceful shutdown for edge functions #513
Conversation
|
|
View your CI Pipeline Execution ↗ for commit b99dc84
☁️ Nx Cloud last updated this comment at |
b0988ce to
4106bd7
Compare
1f0dbdd to
133efc3
Compare
49402ce to
8528e37
Compare
8528e37 to
4708057
Compare
4708057 to
2bfd197
Compare
133efc3 to
31944b5
Compare
2bfd197 to
fea048b
Compare
31944b5 to
d43f53b
Compare
fea048b to
36c9a31
Compare
d43f53b to
aca53bc
Compare
36c9a31 to
1d9cf44
Compare
🔍 Preview Deployment: Website✅ Deployment successful! 🔗 Preview URL: https://pr-513.pgflow.pages.dev 📝 Details:
_Last updated: _ |
1d9cf44 to
b99dc84
Compare
🚀 Production Deployment: Website✅ Successfully deployed to production! 🔗 Production URL: https://pgflow.dev 📝 Details:
Deployed at: 2025-12-08T10:33:24+01:00 |

Implement Worker Tracking for Improved Reliability
This PR adds functionality to track edge function workers more effectively, improving the reliability of worker management:
Added two new methods to the
Queriesclass:trackWorkerFunction()- Registers an edge function for monitoring by theensure_workers()cron jobmarkWorkerStopped()- Marks a worker as stopped during graceful shutdownUpdated worker lifecycle implementations to call
trackWorkerFunction()early in the startup process, which:last_invoked_atto prevent cron from pinging during startup (debounce)Enhanced the shutdown process in
SupabasePlatformAdapter:stopped_atAdded comprehensive unit tests for the new functionality
These changes improve worker reliability by providing better signaling between workers and the monitoring system, ensuring faster recovery from failures and more efficient worker management.