How to handle scheduled jobs in a load-balanced Wasp deployment?
Hi Wasp community!
I'm deploying my Wasp application with load balancing using Nginx, and I have a question about scheduled jobs (using PgBoss).
My setup: - 2 Wasp server instances behind Nginx load balancer - Using dailyStatsJob for analytics - PostgreSQL database shared between instances
My concern: Will scheduled jobs run multiple times if I have multiple server instances? For example, will dailyStatsJob execute on both server instances and potentially create duplicate data?
Questions: 1. Does PgBoss automatically handle job deduplication across multiple instances? 2. Do I need to designate one instance as the "primary" for running jobs? 3. What's the recommended approach for scheduled jobs in a load-balanced Wasp deployment?