I have some tasks which take config data as an argument. That config data has changed, but when the job is resumed those tasks still use the old config values. Is there a way to update this sort of info when using resume points? Or should I be using a different method to obtain this config data so stale values aren't used when the job is resumed?
That’s odd, but it will completely depend on how you’re injecting the config data. Is it being placed into window state somehow? Otherwise I’m not sure how it could get the old values unless there was a mistake somewhere
I believe it is only injected as args on task functions. I'll double-check if it's leaking through anywhere else.
If that’s the case, I have no idea how it could happen as they are inject directly from the new job’s data at the time the peers start on the job
Are non-segment task arguments remembered at all? I've gotten errors when they were not serializable, but again perhaps that was because I let them get into some other portion of the state.
Hmmmm, I just found where I added that info to a window definition map as a hacky way of making it available to make it available to an emitter function. That's probably a bad practice.
yeah, that’s probably where it all went wrong. I prefer to just get at that data from the event map which is under :task-event
in the state event map
assuming you only need it in the the windowing code
Not quite following there. I need some Datomic configuration data to be able to run a query in the emit function assigned to a window. Can that be made available in the job definition, or does it have to be passed through by some other mechanism?
Trigger emit gets passed the window map, trigger map, as well as the state event map http://www.onyxplatform.org/docs/cheat-sheet/latest/#trigger-entry/:trigger/emit
So you can put that datomic config data in either the window map, trigger map (each passed in), or you can stick it in the task map, which you can get from the state event map under :task-event
:onyx.core/task-map
http://www.onyxplatform.org/docs/cheat-sheet/latest/#state-event/:task-event
Thanks, put it in the task map, worked great. Hopefully that should ensure I get the latest config values on restart.