mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] runbot_merge: don't select content when locking rows
It might not be a huge amount of extra work since we're never actually retrieving the rows, but it still seems completely unnecessary. Sadly we can't do something cleaner like an aggregation, because aggregating requires moving the locking query to a subquery, and experimentally that seems slower than just ignoring / discarding the result set.
This commit is contained in:
parent
9f22305903
commit
a8e4d6dfee
@ -184,7 +184,7 @@ class FreezeWizard(models.Model):
|
||||
# we don't want to run concurrently to the crons above, though we
|
||||
# don't need to prevent read access to them
|
||||
self.env.cr.execute(
|
||||
'SELECT * FROM ir_cron WHERE id =ANY(%s) FOR SHARE NOWAIT',
|
||||
'SELECT FROM ir_cron WHERE id =ANY(%s) FOR SHARE NOWAIT',
|
||||
[conflict_crons.ids]
|
||||
)
|
||||
|
||||
@ -195,7 +195,7 @@ class FreezeWizard(models.Model):
|
||||
master, rest = project_id.branch_ids[0], project_id.branch_ids[1:]
|
||||
if self.bump_pr_ids and master.active_staging_id:
|
||||
self.env.cr.execute(
|
||||
'SELECT * FROM runbot_merge_stagings WHERE id = %s FOR UPDATE NOWAIT',
|
||||
'SELECT FROM runbot_merge_stagings WHERE id = %s FOR UPDATE NOWAIT',
|
||||
[master.active_staging_id.id]
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user