-
|
Hi! I need to deploy a breaking change to job arguments in production. We have 2 workers and may have jobs queued with the old structure. We would need to handle both old and new formats during deployment. // current
type SendEmailArgs struct {
User types.User `json:"user"`
}
// new (breaking change)
type SendEmailArgs struct {
UserID uuid.UUID `json:"user_id"`
}Questions:
Thanks for any advice! 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
@almottier I would typically handle this by keeping both sets of args around for a transitional period, following this rough strategy:
You could definitely adopt a versioned strategy if you're trying to solve this with a general pattern beyond just this one simple case. Not sure if this is enough to help you, let me know if I can elaborate on anything! |
Beta Was this translation helpful? Give feedback.
@almottier I would typically handle this by keeping both sets of args around for a transitional period, following this rough strategy:
UserIDfield and start using it on the enqueueing side where you can.UserIDbut fall back toUserif that's all there is (can be deployed together with the above).UserIDremaining.You could definitely adopt a versioned strategy if you're trying to solve this with a general pattern beyond just this one simple case.
Not sure if this is enough to help you, let me know if I can elaborate on anything!