← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 816858] Re: ir.cron can't be inherited properly

 

Thibaut,

I've been working recently on modifying the ir.cron scheduling so that
it can spawn a (bounded) number of threads, thus processing a few jobs
concurrently.

The work is visible at https://code.launchpad.net/~openerp-dev
/openobject-server/trunk-threaded-cron-vmt/+merge/68064

Because of the involved concurrency and database locking, I don't think
it is wise to inherit and modify the _poolJobs method.

Depending on your need, we might find something else. A possibility is
to not start the normal scheduling thread and hoping to replace ir.cron
later and get run via a self.pool.get(), but instead start yourself the
scheduling mechanism you want.

I will close the report; feel free to reopen it with additional
information.

** Changed in: openobject-server
       Status: Confirmed => Invalid

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/816858

Title:
  ir.cron can't be inherited properly

Status in OpenERP Server:
  Invalid

Bug description:
  Hi,

  I'm working on ir.cron to extend its possibilities, but it can't be
  inherited easily. The problem is that when the server starts, the
  method _poolJobs of ir.cron is called. This method reference itself
  with this line :

  self.setAlarm(self._poolJobs, next_call, db_name, db_name)

  The problem is that if you inherit ir.cron, the _poolJobs method will
  not reference the new object, but keep referencing the old one. This
  means that if you redefine _callback() in your new ir.cron, it will
  never be called.

  I think that a small fix could be to use setAlarm on
  self.pool.get('ir.cron')._poolJobs ?

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/816858/+subscriptions


References