Skip to content

Commit

Permalink
Drop the poll_interval option.
Browse files Browse the repository at this point in the history
Fixes #222
  • Loading branch information
jamadden committed May 9, 2019
1 parent 65689b3 commit f00ee45
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -81,7 +81,7 @@ matrix:
script:
# coverage slows PyPy down from 2minutes to 12+.
# But don't run the pymysql/pypy tests twice.
- if [[ $TRAVIS_PYTHON_VERSION == 3.7 ]]; then pylint --rcfile=.pylintrc relstorage -f parseable -r n; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.7 && $ENV == mysql ]]; then pylint --rcfile=.pylintrc relstorage -f parseable -r n; fi
- if [[ $TRAVIS_PYTHON_VERSION == pypy* ]]; then python -m relstorage.tests.alltests -v; fi
- if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then coverage run -m relstorage.tests.alltests -v; fi
after_success:
Expand Down
4 changes: 3 additions & 1 deletion CHANGES.rst
Expand Up @@ -2,7 +2,6 @@
Changes
=========


3.0.0 (unreleased)
==================

Expand All @@ -14,6 +13,9 @@

- Drop support for ZODB 4 and ZEO 4.

- Drop the ``poll_interval`` parameter. It has been deprecated with a
warning and ignored since 2.0.0b2. See :issue:`222`.

2.1.1 (2019-01-07)
==================

Expand Down
2 changes: 1 addition & 1 deletion doc/zodburi.rst
Expand Up @@ -38,7 +38,7 @@ RelStorage-constructor related
These arguments generally inform the RelStorage constructor about
values of the same names :

poll_interval, cache_local_mb, commit_lock_timeout, commit_lock_id,
cache_local_mb, commit_lock_timeout, commit_lock_id,
read_only, shared_blob_dir, keep_history, pack_gc, pack_dry_run,
strict_tpc, create, blob_cache_size, blob_cache_size_check,
blob_cache_chunk_size, replica_timeout, pack_batch_timeout,
Expand Down
17 changes: 6 additions & 11 deletions relstorage/options.py
Expand Up @@ -14,7 +14,6 @@

from __future__ import absolute_import

import warnings
from relstorage._compat import PYPY

class Options(object):
Expand All @@ -28,8 +27,11 @@ class Options(object):
Alternatively, the RelStorage constructor accepts an options
parameter, which should be an Options instance.
.. versionchanged:: 3.0
No longer accepts the ``poll_interval`` option.
.. versionchanged:: 2.0b2
The `poll_interval` option is now ignored and raises a warning. It is always
The ``poll_interval`` option is now ignored and raises a warning. It is always
effectively 0.
.. versionchanged:: 2.0b7
Expand Down Expand Up @@ -109,12 +111,6 @@ class Options(object):
share_local_cache = True

def __init__(self, **kwoptions):
poll_interval = kwoptions.pop('poll_interval', self)
if poll_interval is not self:
# Would like to use a DeprecationWarning, but they're ignored
# by default.
warnings.warn("poll_interval is ignored", stacklevel=3)

for key, value in kwoptions.items():
if not hasattr(self, key):
raise TypeError("Unknown parameter: %s" % key)
Expand All @@ -135,9 +131,8 @@ def copy_valid_options(cls, other_options):

@classmethod
def valid_option_names(cls):
# Still include poll_interval so we can warn
return ['poll_interval'] + [x for x in vars(cls)
if not callable(getattr(cls, x)) and not x.startswith('_')]
return [x for x in vars(cls)
if not callable(getattr(cls, x)) and not x.startswith('_')]

def __repr__(self):
return 'relstorage.options.Options(**' + repr(self.__dict__) + ')'
6 changes: 1 addition & 5 deletions relstorage/tests/reltestbase.py
Expand Up @@ -485,11 +485,7 @@ def checkAutoReconnectOnSync(self):
db.close()

def checkCachePolling(self):
# NOTE: This test still sets poll_interval, a deprecated
# option that does nothing. We keep it around to verify that
# this scenario still works either way.
self._storage = self.make_storage(
poll_interval=3600, share_local_cache=False)
self._storage = self.make_storage(share_local_cache=False)

db = DB(self._storage)
try:
Expand Down
2 changes: 1 addition & 1 deletion relstorage/zodburi_resolver.py
Expand Up @@ -158,7 +158,7 @@ def factory(options):
# The relstorage support is inspired by django-zodb.

class RelStorageURIResolver(Resolver):
_int_args = ('poll_interval', 'cache_local_mb', 'commit_lock_timeout',
_int_args = ('cache_local_mb', 'commit_lock_timeout',
'commit_lock_id', 'read_only', 'shared_blob_dir',
'keep_history', 'pack_gc', 'pack_dry_run',
'create', 'demostorage',)
Expand Down

0 comments on commit f00ee45

Please sign in to comment.