Move stray magic values to literals.py in the checkout app. gh-issue #225.
This commit is contained in:
@@ -5,9 +5,9 @@ import logging
|
||||
from lock_manager import Lock, LockError
|
||||
from mayan.celery import app
|
||||
|
||||
from .literals import CHECKOUT_EXPIRATION_LOCK_EXPIRE
|
||||
from .models import DocumentCheckout
|
||||
|
||||
LOCK_EXPIRE = 50
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ def task_check_expired_check_outs():
|
||||
lock_id = 'task_expired_check_outs'
|
||||
try:
|
||||
logger.debug('trying to acquire lock: %s', lock_id)
|
||||
lock = Lock.acquire_lock(lock_id, LOCK_EXPIRE)
|
||||
lock = Lock.acquire_lock(name=lock_id, timeout=CHECKOUT_EXPIRATION_LOCK_EXPIRE)
|
||||
logger.debug('acquired lock: %s', lock_id)
|
||||
DocumentCheckout.objects.check_in_expired_check_outs()
|
||||
lock.release()
|
||||
|
||||
Reference in New Issue
Block a user