mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-09 07:38:12 +08:00
Changed locking mechanism
* all new tasks start as timeouts. This makes the queries a lot simpler. * In BULK mode, the bulk update for the lock was causing actual database locks. The lock updates are now iterated.
This commit is contained in:
@@ -268,9 +268,12 @@ def test_orm():
|
||||
broker.enqueue('test')
|
||||
Conf.BULK = 5
|
||||
tasks = broker.dequeue()
|
||||
assert broker.lock_size() == Conf.BULK
|
||||
for task in tasks:
|
||||
assert task is not None
|
||||
broker.acknowledge(task[0])
|
||||
# test lock size
|
||||
assert broker.lock_size() == 0
|
||||
# test duplicate acknowledge
|
||||
broker.acknowledge(task[0])
|
||||
# delete queue
|
||||
|
||||
Reference in New Issue
Block a user