Skip to content

Commit

Permalink
Fix typo (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
Abildin authored and cameronmaske committed Nov 15, 2019
1 parent 0ee16d4 commit 4f68b6b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion HISTORY.rst
Expand Up @@ -6,7 +6,7 @@ History
2019-08-21

Behind the scenes, changed how key's are generated from task function and arguments.
No longer uses ``inspect.getcallargs`` (deprecrated) and is stored on ``__init__``.
No longer uses ``inspect.getcallargs`` (deprecated) and is stored on ``__init__``.
Should fix issues if tasks are wrapped by other libraries (i.e. sentry-python).

3.0.0
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Expand Up @@ -200,7 +200,7 @@ Configuration:

- ``blocking`` (boolean value: default ``False``) - If set to ``True``, scheduling a task (by ``.delay/.apply_async``) will block for X seconds to acquire the lock (see: ``blocking_timeout`` below). If no lock could be acquired after X seconds, will raise an ``AlreadyQueued`` exception. This is a very specific use-case scenario and by default is disabled.

- ``blocking_timeout`` (int or float value: default ``1``) - How many seconds the task will block trying to aquire the lock, if ``blocking`` is set to ``True``. Setting this to ``None`` set's no timeout (equivalent to infinite seconds).
- ``blocking_timeout`` (int or float value: default ``1``) - How many seconds the task will block trying to acquire the lock, if ``blocking`` is set to ``True``. Setting this to ``None`` set's no timeout (equivalent to infinite seconds).



Expand Down Expand Up @@ -280,7 +280,7 @@ Example Configuration:
}
Flask Intergration
Flask Integration
------------------
To avoid ``RuntimeError: Working outside of application context`` errors when using ``celery_once`` with `Flask <http://flask.pocoo.org/docs/1.0/>`_, you need to make the ``QueueOnce`` task base class application context aware.
If you've implemented Celery following the Flask `documentation <http://flask.pocoo.org/docs/1.0/patterns/celery/#configure>`_ you can extend it like so.
Expand Down
6 changes: 3 additions & 3 deletions celery_once/tasks.py
Expand Up @@ -63,7 +63,7 @@ def unlock_before_run(self):
return self.once.get('unlock_before_run', False)

def __init__(self, *args, **kwargs):
self._siganture = signature(self.run)
self._signature = signature(self.run)
return super(QueueOnce, self).__init__(*args, **kwargs)

def __call__(self, *args, **kwargs):
Expand Down Expand Up @@ -108,7 +108,7 @@ def apply_async(self, args=None, kwargs=None, **options):
return super(QueueOnce, self).apply_async(args, kwargs, **options)

def _get_call_args(self, args, kwargs):
call_args = self._siganture.bind(*args, **kwargs).arguments
call_args = self._signature.bind(*args, **kwargs).arguments
# Remove the task instance from the kwargs. This only happens when the
# task has the 'bind' attribute set to True. We remove it, as the task
# has a memory pointer in its repr, that will change between the task
Expand All @@ -131,7 +131,7 @@ def get_key(self, args=None, kwargs=None):

def after_return(self, status, retval, task_id, args, kwargs, einfo):
"""
After a task has run (both succesfully or with a failure) clear the
After a task has run (both successfully or with a failure) clear the
lock if "unlock_before_run" is False.
"""
# Only clear the lock after the task's execution if the
Expand Down

0 comments on commit 4f68b6b

Please sign in to comment.