Add logs on the synchronization process and threads them

Registered by Joël Grand-Guillaume @ camptocamp on 2011-04-15

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 on 2011-06-07

Related branches

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_sale_order....

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_all_products(...)
    for product in self.browse(cr, uid, ids, ...)
        self._export_one_product(cr, uid, product, ...)
    ...

@external_report_line
def _export_one_product(cr, uid, product,...) # product is a browse instance, private method
    self.ext_export(...)
    ...

In external_report, we create the report, call the method, close the report
In external_report_line, inside a try except we call the method, and in the except we log the fails.

Have you the same point of view ?

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.