[FIX] base: log cron start/done also when running manually
The INFO "Starting job x" and "Job x done" logs are only logged for the automatic executing of the cron by the cron worker. When running the cron manually via its form view, no INFO was logged. The technical support is reporting problems where a cron server action is running twice at a same moment leading to problems such as mass-mailing sending emails twice. There is a mutual exclusion mechanism for cron workers but no exclusion mechanism seems in place for http worker vs cron worker. Logging the "run manually" actions will help us figuring out the problems. X-original-commit: fcc2eabc671557e610688eac93bae333b0a2c119 Part-of: odoo/odoo#157203
This commit is contained in:
@@ -93,7 +93,9 @@ class ir_cron(models.Model):
|
||||
def method_direct_trigger(self):
|
||||
self.check_access_rights('write')
|
||||
for cron in self:
|
||||
_logger.info('Manually starting job `%s`.', cron.name)
|
||||
cron.with_user(cron.user_id).with_context({'lastcall': cron.lastcall}).ir_actions_server_id.run()
|
||||
_logger.info('Job `%s` done.', cron.name)
|
||||
cron.lastcall = fields.Datetime.now()
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user