Add logs on the synchronization process and threads them
Trouble:
When running sync, we reach the timeout of the client and get no infos about what's goes wrong (or even if it goes well !). No feedback given when something bad happened. Worst, the process stops if something wrong on one entry, blocking all others. It also use lots of system resources cause not threaded.
Suggested solution:
Launch the sync stuffs in threads and assure that the different sync are done in the right order (don't allow to launch the stock level update before launching the export catalog). Record trouble in a log and continue the syncing process when something bad happend (at least each time it's possible). Give the feed-back on the sync process (through log) in OpenERP requests, like it is done for MRP Scheduler.
Blueprint information
- Status:
- Started
- Approver:
- None
- Priority:
- Essential
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- Guewen Baconnier @ Camptocamp
- Definition:
- Approved
- Series goal:
- None
- Implementation:
- Slow progress
- Milestone target:
- None
- Started by
- Joël Grand-Guillaume @ camptocamp
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
Sébastien Beau:
I start to refactor the code, after some discution with Raphael the best solution for this feature seem to use a decorator.
So for each syncronization funtion we will just have to had
@mydecorateur
def import_
I will try to do it for the 6.1 but not sure that I will have the time to finish it
Guewen Baconnier:
Yes I also think that we have to use decorators.
I think we'll need to do some refactoring on the actual methods to split the loops and have 2 decorators.
@external_report
def export_
for product in self.browse(cr, uid, ids, ...)
...
@external_
def _export_
self.
...
In external_report, we create the report, call the method, close the report
In external_
Have you the same point of view ?