moved static methods to module functions

medic is now sentinel and runs in it's own process
sentinel shutdown procedure more stable
This commit is contained in:
Ilan Steemers
2015-06-18 14:10:48 +02:00
parent 4faba63d54
commit 90b5b0d6ab
9 changed files with 244 additions and 231 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
import time
# simple countdown
def count(n):
def countdown(n):
start_time = time.time()
while n > 0:
n -= 1
+8 -4
View File
@@ -1,11 +1,15 @@
import sys, os
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../')
import pytest
from django_q import Cluster
@pytest.fixture
def qworker():
@pytest.fixture(scope='session')
def cluster():
return Cluster()
def test_worker(qworker):
assert len(qworker.stable) == qworker.stable_size
def test_worker(cluster):
assert len(cluster.stable) == cluster.stable_size