I am implementing a recurring email scheduling feature using the PGBoss library. The user registers schedules to send emails on specific days of the week, and I’m registering multiple schedules using the same schedule name with boss.schedule(name, cronExpression). However, when the same name is used, schedules are overwritten. On the other hand, if I register schedules with different names, it becomes problematic to have multiple boss.work handlers with different names for the same logic, especially since I don’t know how many schedules will be registered.
What I’m looking for is a way to assign a unique identifier to each schedule, even when using the same schedule name, to avoid overwriting and allow selecting and deleting specific schedules by their unique identifiers. Is there a better way to manage schedules uniquely without overwriting?
Hello,
I am implementing a recurring email scheduling feature using the PGBoss library. The user registers schedules to send emails on specific days of the week, and I’m registering multiple schedules using the same schedule name with boss.schedule(name, cronExpression). However, when the same name is used, schedules are overwritten. On the other hand, if I register schedules with different names, it becomes problematic to have multiple boss.work handlers with different names for the same logic, especially since I don’t know how many schedules will be registered.
What I’m looking for is a way to assign a unique identifier to each schedule, even when using the same schedule name, to avoid overwriting and allow selecting and deleting specific schedules by their unique identifiers. Is there a better way to manage schedules uniquely without overwriting?
Thank you!