Skip to content

Commit

Permalink
dependencies: update the dependencies lock file
Browse files Browse the repository at this point in the history
* Fixes problem with regex in datetime:
scrapinghub/dateparser#1045
* Fixes flask_celerxext mappings for scheduler.

Co-Authored-by:  Peter Weber <Peter.Weber@rero.ch>
  • Loading branch information
rerowep and rerowep committed Mar 17, 2022
1 parent b734790 commit c6e9685
Show file tree
Hide file tree
Showing 7 changed files with 282 additions and 230 deletions.
501 changes: 276 additions & 225 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -52,7 +52,7 @@ jsonschema = "<4.0.0"

## RERO ILS specific python modules
PyYAML = ">=5.3.1"
dateparser = ">=0.7.0"
dateparser = ">=1.1.1"
isbnlib = ">=3.9.1"
requests = ">=2.20.0"
polib = "*"
Expand Down
1 change: 0 additions & 1 deletion rero_ils/config.py
Expand Up @@ -292,7 +292,6 @@ def _(x):
# Celery configuration
# ====================

BROKER_URL = 'amqp://guest:guest@localhost:5672/'
#: URL of message broker for Celery (default is RabbitMQ).
CELERY_BROKER_URL = 'amqp://guest:guest@localhost:5672/'
#: URL of backend for result storage (default is Redis).
Expand Down
4 changes: 3 additions & 1 deletion rero_ils/schedulers.py
Expand Up @@ -25,6 +25,7 @@
from celery import current_app as current_celery
from celery.utils.log import get_logger
from flask.cli import with_appcontext
from flask_celeryext._mapping import FLASK_TO_CELERY_MAPPING
from redisbeat.scheduler import RedisScheduler as OriginalRedisScheduler
from werkzeug.local import LocalProxy

Expand Down Expand Up @@ -110,7 +111,8 @@ def merge_inplace(self, tasks):

def setup_schedule(self):
"""Init entries from CELERY_BEAT_SCHEDULE."""
config = deepcopy(self.app.conf.CELERY_BEAT_SCHEDULE)
beat_schedule = FLASK_TO_CELERY_MAPPING['CELERY_BEAT_SCHEDULE']
config = deepcopy(self.app.conf.get(beat_schedule))
self.merge_inplace(config)
msg = 'Current schedule:\n{tasks}'.format(
tasks='\n'.join(self.display_all(prefix='- Tasks: '))
Expand Down
1 change: 0 additions & 1 deletion tests/conftest.py
Expand Up @@ -150,7 +150,6 @@ def can_delete_json_header():
@pytest.fixture(scope='module')
def app_config(app_config):
"""Create temporary instance dir for each test."""
app_config['BROKER_URL'] = 'memory://'
app_config['CELERY_BROKER_URL'] = 'memory://'
app_config['RATELIMIT_STORAGE_URL'] = 'memory://'
app_config['CACHE_TYPE'] = 'simple'
Expand Down
1 change: 0 additions & 1 deletion tests/scheduler/conftest.py
Expand Up @@ -34,7 +34,6 @@ def create_app():
@pytest.fixture(scope='module')
def app_config(app_config):
"""Create temporary instance dir for each test."""
app_config['BROKER_URL'] = 'memory://'
app_config['CELERY_BROKER_URL'] = 'memory://'
app_config['RATELIMIT_STORAGE_URL'] = 'memory://'
app_config['CACHE_TYPE'] = 'simple'
Expand Down
2 changes: 2 additions & 0 deletions tests/scheduler/test_scheduler.py
Expand Up @@ -36,6 +36,8 @@ def test_scheduler(app):
# clean the REDIS DB
current_scheduler._remove_db()
# create the scheduled test tasks
print('--->', app.config.get('CELERY_BEAT_SCHEDULE'))
print('>>>>', current_celery.conf.get('beat_schedule'))
RedisScheduler(app=current_celery)
assert current_scheduler.display_all() == display_tasks
assert not current_scheduler.get_entry_enabled('bulk-indexer')
Expand Down

0 comments on commit c6e9685

Please sign in to comment.