Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Separate lock backend from celery backend #22

Closed
wants to merge 46 commits into from

Conversation

Salamek
Copy link

@Salamek Salamek commented Apr 25, 2018

Hi, locking mechanism in Flask-Celery-Helper currently uses celery result backend, that is not "optimal" (cant use rabbitmq as celery result backend+locking).
This PR fixes #19 that, it allows (actualy requires) setting custom separate lock backend in configuration option CELERY_TASK_LOCK_BACKEND supported lock backends are:

  • redis
  • sqlalchemy
  • fileystem (only local, ok to use with single task producer and also fallback when CELERY_TASK_LOCK_BACKEND is not specified with warning message)

These changes required some refactoring so flask_celery is not a single file anymore...
Tests should went OK, only appveyor sometimes fails cos Chocolatey fails to install/run rabbitmq properly for some reason...

@codecov-io
Copy link

codecov-io commented Apr 25, 2018

Codecov Report

Merging #22 into master will increase coverage by 2.77%.
The diff coverage is 94.24%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #22      +/-   ##
==========================================
+ Coverage   91.47%   94.24%   +2.77%     
==========================================
  Files           1        8       +7     
  Lines         129      226      +97     
  Branches       16       18       +2     
==========================================
+ Hits          118      213      +95     
- Misses          4        9       +5     
+ Partials        7        4       -3
Impacted Files Coverage Δ
flask_celery/backends/database/sessions.py 100% <100%> (ø)
flask_celery/exceptions.py 100% <100%> (ø)
flask_celery/backends/database/models.py 100% <100%> (ø)
flask_celery/backends/redis.py 100% <100%> (ø)
flask_celery/backends/base.py 100% <100%> (ø)
flask_celery/backends/database/__init__.py 83.92% <83.92%> (ø)
flask_celery/lock_manager.py 96.07% <96.07%> (ø)
flask_celery/backends/filesystem.py 96.42% <96.42%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92bd3b0...cfc8012. Read the comment docs.

@Salamek
Copy link
Author

Salamek commented Jun 18, 2018

@Robpol86 Hi, any chance for review and merge ?
Tests works ok, travis failed cos their pypy img got broken or something... and i cant force rerun from my end.

@Salamek Salamek closed this Sep 18, 2020
@Salamek Salamek deleted the refactor branch September 18, 2020 11:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for AMQPBackend?
2 participants