[IMP] cron: alternative implementation:
authorVo Minh Thu <vmt@openerp.com>
Wed, 28 Mar 2012 09:03:20 +0000 (11:03 +0200)
committerVo Minh Thu <vmt@openerp.com>
Wed, 28 Mar 2012 09:03:20 +0000 (11:03 +0200)
commit1b0bfd1044dc00fcba9ea859cd72259b85e1b11a
treed8416845d7ca5ae5cd8437a3853a48add11e73bb
parent91ff283aca2dcc68eee6c1b8a899c7f5b2694a18
[IMP] cron: alternative implementation:

- The previous implementation was optimized to make few queries to the database
  but needed to keep some internal state.
- That state was updated whenever the ir_cron table was modified by the ORM
  (this works only when the cron and web processes/threads are inside a single
  OpenERP server instance).
- The new implementation is instead polling the database.
- This is deemed acceptable in `normal` situation (i.e. not a SaaS with
  thousand of databases).
- This makes it possible to avoid sharing state or the use of IPC.
- This makes it possible to add/remove additional worker processes,
  possibly on different machines.
- The code of the older implementation is removed in this commit but
  will be added back in a later commit: this is the 6.1 stable branch
  and we don't want to change the existing installation, but simply
  provide a solution for those running OpenERP with Gunicorn (which
  uses processes for which no cron state were shared).

bzr revid: vmt@openerp.com-20120328090320-vshsfv3gt1ck34s1
openerp-cron-worker [new file with mode: 0755]
openerp-server
openerp/addons/base/ir/ir_cron.py
openerp/cron.py
openerp/modules/registry.py
openerp/service/__init__.py