Uh oh!
There was an error while loading. Please reload this page.
[ON HOLD][13.0] Add job_auto_delay decorator - #270
Conversation
lmignon
left a comment
There was a problem hiding this comment.
LGTM and good idea! (Code review)
It makes every calls to "cron_actions" run in queue jobs. The jobs have an identity key with "identity_exact", meaning that only one occurence of a job for the same buffer with the same arguments (only_nfp) will be created at a time (e.g. when the state of a stock.move is changed several times in the same transaction or in a different transaction in a short timeframe). It needs OCA/queue#270
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
cd49316 to
9659afeCompareguewen
commented
Oct 29, 2020
@simahawk I fixed the small glitches and force-pushed directly |
guewen
commented
Oct 29, 2020
Do not merge yet, I'm investigating an error: And I suspect it happens when other modules redefine the same method. To be continued... |
guewen
commented
Oct 29, 2020
I confirm this. I hope I can find a way to prevent this. |
guewen
commented
Oct 29, 2020
This is not an issue only with module_b and module_c have no dependencies on each other. In It seems that depending on the loading order, we'll lose the properties added by |
This is a new decorator, to use instead of @job on methods, that transforms a method to a method automatically delayed as job when called. A typical use case is when a method in a module we don't control is called synchronously in the middle of another method, and we'd like all the calls to this method become asynchronous.
9659afe to
68d6bc0Compare
This is a new decorator, to use instead of
@jobon methods,that transforms a method to a method automatically delayed as job when
called.
A typical use case is when a method in a module we don't control is called
synchronously in the middle of another method, and we'd like all the calls
to this method become asynchronous.
Closes#238