[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
cd49316 to
9659afe
Compare
|
@simahawk I fixed the small glitches and force-pushed directly |
|
Do not merge yet, I'm investigating an error: And I suspect it happens when other modules redefine the same method. To be continued... |
I confirm this. I hope I can find a way to prevent this. |
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
68d6bc0
Compare
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