Rename try_advisory_lock to advisory_lock_or_retry #139

Merged
merged 1 commit into from Nov 3, 2015

Conversation

Projects
None yet
4 participants
@guewen
Member

guewen commented Nov 3, 2015

It is no longer a context manager, because we would expect the lock to be
released at the end of the 'with' statement but it lasts until the end of the
transaction.

@guewen

This comment has been minimized.

Show comment
Hide comment
@guewen

guewen Nov 3, 2015

Member

As discussed in #139 /cc @lmignon @pedrobaeza @damdam-s
I renamed the method in advisory_lock_or_retry which reflects better the behavior I think.

Member

guewen commented Nov 3, 2015

As discussed in #139 /cc @lmignon @pedrobaeza @damdam-s
I renamed the method in advisory_lock_or_retry which reflects better the behavior I think.

@pedrobaeza

This comment has been minimized.

Show comment
Hide comment
@pedrobaeza

pedrobaeza Nov 3, 2015

Contributor

You should change tests accordingly the rename:

2015-11-03 07:42:01,583 22882 ERROR openerp_test openerp.addons.connector.tests.test_connector:   File "/home/travis/build/OCA/connector/connector/tests/test_connector.py", line 229, in test_concurrent_import_lock
2015-11-03 07:42:01,583 22882 ERROR openerp_test openerp.addons.connector.tests.test_connector:      with connector_unit.try_advisory_lock(lock):
2015-11-03 07:42:01,583 22882 ERROR openerp_test openerp.addons.connector.tests.test_connector: ` AttributeError: 'ConnectorUnit' object has no attribute 'try_advisory_lock'
Contributor

pedrobaeza commented Nov 3, 2015

You should change tests accordingly the rename:

2015-11-03 07:42:01,583 22882 ERROR openerp_test openerp.addons.connector.tests.test_connector:   File "/home/travis/build/OCA/connector/connector/tests/test_connector.py", line 229, in test_concurrent_import_lock
2015-11-03 07:42:01,583 22882 ERROR openerp_test openerp.addons.connector.tests.test_connector:      with connector_unit.try_advisory_lock(lock):
2015-11-03 07:42:01,583 22882 ERROR openerp_test openerp.addons.connector.tests.test_connector: ` AttributeError: 'ConnectorUnit' object has no attribute 'try_advisory_lock'
@guewen

This comment has been minimized.

Show comment
Hide comment
@guewen

guewen Nov 3, 2015

Member

You should change tests accordingly the rename:

This is what happen when I code before being totally awake, and you caught it even before I could realize :-D
Tests are corrected.

Member

guewen commented Nov 3, 2015

You should change tests accordingly the rename:

This is what happen when I code before being totally awake, and you caught it even before I could realize :-D
Tests are corrected.

Rename try_advisory_lock to advisory_lock_or_retry
It is no longer a context manager, because we would expect the lock to be
released at the end of the 'with' statement but it lasts until the end of the
transaction.
@lmignon

This comment has been minimized.

Show comment
Hide comment
@lmignon

lmignon Nov 3, 2015

Contributor

👍 Thank you for the changes.

Contributor

lmignon commented Nov 3, 2015

👍 Thank you for the changes.

@pedrobaeza

This comment has been minimized.

Show comment
Hide comment
@pedrobaeza

pedrobaeza Nov 3, 2015

Contributor

Thanks 👍

Contributor

pedrobaeza commented Nov 3, 2015

Thanks 👍

@damdam-s

This comment has been minimized.

Show comment
Hide comment

damdam-s commented Nov 3, 2015

👍

lmignon added a commit that referenced this pull request Nov 3, 2015

Merge pull request #139 from guewen/advisory-lock-common
Rename try_advisory_lock to advisory_lock_or_retry

@lmignon lmignon merged commit e57a0d3 into OCA:8.0 Nov 3, 2015

1 of 2 checks passed

ci/runbot runbot build 3118858-139-15e0e4
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

guewen added a commit to guewen/connector-magento that referenced this pull request Nov 3, 2015

@guewen guewen referenced this pull request in OCA/connector-magento Nov 3, 2015

Merged

Prevent concurrent import with an advisory lock #163

guewen added a commit to guewen/connector-magento that referenced this pull request Nov 3, 2015

atchuthan added a commit to sodexis/connector-magento that referenced this pull request May 19, 2016

atchuthan added a commit to sodexis/connector-magento that referenced this pull request Oct 18, 2016

guewen added a commit to guewen/connector-magento that referenced this pull request Jun 20, 2017

blaggacao pushed a commit to xoes-oca/magentoerpconnect that referenced this pull request Dec 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment