Skip to content

is_locked#

is_locked returns whether the lock is locked or unlocked.

Definition#

1
2
3
def is_locked(
    self,
) -> bool

Examples#

1
2
3
4
5
6
7
8
9
def work(
    self,
    task,
):
    single_access_api_url = task.kwargs['single_access_api_url']

    lock = self.lock('single_access_api')
    if lock.is_locked():
        self.requeue()