[15.0][MIG] base_cron_exclusion
parent
9dbefb8968
commit
aefff7c52c
|
@ -23,7 +23,7 @@ Base Cron Exclusion
|
|||
:target: https://runbot.odoo-community.org/runbot/149/14.0
|
||||
:alt: Try me on Runbot
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
||||
This module extends the functionality of scheduled actions to allow you to
|
||||
select the ones that should not run simultaneously.
|
||||
|
@ -68,6 +68,7 @@ Contributors
|
|||
* Lois Rilo <lois.rilo@forgeflow.com>
|
||||
* Jordi Ballester <jordi.ballester@forgeflow.com>
|
||||
* Bhavesh Odedra <bodedra@opensourceintegrators.com>
|
||||
* Christopher Ormaza <chris.ormaza@forgeflow.com>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
@ -85,10 +86,13 @@ promote its widespread use.
|
|||
.. |maintainer-LoisRForgeFlow| image:: https://github.com/LoisRForgeFlow.png?size=40px
|
||||
:target: https://github.com/LoisRForgeFlow
|
||||
:alt: LoisRForgeFlow
|
||||
.. |maintainer-ChrisOForgeFlow| image:: https://github.com/ChrisOForgeFlow.png?size=40px
|
||||
:target: https://github.com/ChrisOForgeFlow
|
||||
:alt: ChrisOForgeFlow
|
||||
|
||||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|
||||
Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
|
||||
|
||||
|maintainer-LoisRForgeFlow|
|
||||
|maintainer-LoisRForgeFlow| |maintainer-ChrisOForgeFlow|
|
||||
|
||||
This module is part of the `OCA/server-tools <https://github.com/OCA/server-tools/tree/14.0/base_cron_exclusion>`_ project on GitHub.
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
# Copyright 2017-19 ForgeFlow S.L. (https://www.forgeflow.com)
|
||||
# Copyright 2017-21 ForgeFlow S.L. (https://www.forgeflow.com)
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
{
|
||||
"name": "Base Cron Exclusion",
|
||||
"summary": "Allow you to select scheduled actions that should not run "
|
||||
"simultaneously.",
|
||||
"version": "14.0.1.0.0",
|
||||
"version": "15.0.1.0.0",
|
||||
"author": "ForgeFlow, Odoo Community Association (OCA)",
|
||||
"maintainers": ["LoisRForgeFlow"],
|
||||
"maintainers": ["LoisRForgeFlow", "ChrisOForgeFlow"],
|
||||
"development_status": "Production/Stable",
|
||||
"website": "https://github.com/OCA/server-tools",
|
||||
"category": "Tools",
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# Copyright 2017-19 ForgeFlow S.L. (https://www.forgeflow.com)
|
||||
# Copyright 2017-21 ForgeFlow S.L. (https://www.forgeflow.com)
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
import logging
|
||||
|
||||
from odoo import _, api, fields, models, sql_db
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
@ -61,11 +61,10 @@ class IrCron(models.Model):
|
|||
return lock_cr
|
||||
|
||||
@classmethod
|
||||
def _process_job(cls, job_cr, job, cron_cr):
|
||||
db = sql_db.db_connect(cls.pool._db.dbname)
|
||||
def _process_job(cls, db, cron_cr, job):
|
||||
locked_crons = cls._lock_mutually_exclusive_cron(db, job["id"])
|
||||
try:
|
||||
res = super(IrCron, cls)._process_job(job_cr, job, cron_cr)
|
||||
res = super(IrCron, cls)._process_job(db, cron_cr, job)
|
||||
finally:
|
||||
locked_crons.close()
|
||||
_logger.debug("released blocks for cron job %s" % job["cron_name"])
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
* Christopher Ormaza <chris.ormaza@forgeflow.com>
|
||||
* Lois Rilo <lois.rilo@forgeflow.com>
|
||||
* Jordi Ballester <jordi.ballester@forgeflow.com>
|
||||
* Bhavesh Odedra <bodedra@opensourceintegrators.com>
|
||||
|
|
Loading…
Reference in New Issue