#76 adds connection checked with timeout

Adds a check for old connections in both the workers and the monitor , every DB_TIMEOUT seconds
This commit is contained in:
Ilan Steemers
2015-09-28 11:42:48 +02:00
parent 4ceee42be9
commit 7075a91d37
3 changed files with 17 additions and 0 deletions
+2
View File
@@ -113,6 +113,7 @@ def test_cluster(broker):
@pytest.mark.django_db
def test_async(broker, admin_user):
broker.list_key = 'cluster_test:q'
Conf.DB_TIMEOUT = 0
broker.delete_queue()
a = async('django_q.tests.tasks.count_letters', DEFAULT_WORDLIST, hook='django_q.tests.test_cluster.assert_result',
broker=broker)
@@ -237,6 +238,7 @@ def test_async(broker, admin_user):
assert fetch(k, 100) is None
assert result(k, 100) is None
broker.delete_queue()
Conf.DB_TIMEOUT = 60
@pytest.mark.django_db