Which code will actually be executed? #168
-
|
If I enqueue a Job, the database will store the path to that job. So I suppose that So what happens if I enqueue a job that will be executed in some minutes, but between enqueuing and running the Job, the code for the Job was updated. Will Sidequest run the new or the old version of the code? Same question for configuration changes: Let's assume that my Job calls an external API and the path to that API could change. Is it better to pass the path to that API as parameter in I suppose that the best way to approach this is to never change an existing Job but rather create new versioned classes so it's always clear what's in the queue. But for my understanding it would help if you could shed some light on what version of the Job code will be executed. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hey Frederik.
Sidequest will always run the script you have on disk, so the new code in your hypothetical situation.
That's completely up to you. It's a design decision.
You can definitely change a job. For example, by fixing a bug in it. But beware. If you change the parameters for example, already enqueued jobs may fail. That said, I'd recommend not changing the job. I'd design it with the API path as a parameter. You can always check a job's parameter on the dashboard or by querying it, so it's clear what's being executed. |
Beta Was this translation helpful? Give feedback.
Hey Frederik.
Sidequest will always run the script you have on disk, so the new code in your hypothetical situation.
That's completely up to you. It's a design decision.