Skip to content

Commit

Permalink
Merge branch 'master' into release23-maint
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Aug 4, 2011
2 parents 4afdb39 + 92d44e5 commit dc92b4d
Show file tree
Hide file tree
Showing 39 changed files with 50 additions and 1,170 deletions.
5 changes: 2 additions & 3 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

2.3.0
=====
:release-date: TBA

:release-date: 2011-08-05 12:00 P.M BST
:tested: cPython: 2.5, 2.6, 2.7; PyPy: 1.5; Jython: 2.5.2

.. _v230-important:
Expand Down Expand Up @@ -355,7 +354,7 @@ News
* ``eventlet_pool_postshutdown``
* ``eventlet_pool_apply``

See :ref:`signals` for more information.
See :mod:`celery.signals` for more information.

* New :setting:`BROKER_TRANSPORT_OPTIONS` setting can be used to pass
additional arguments to a particular broker transport.
Expand Down
10 changes: 4 additions & 6 deletions celery/backends/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,9 @@ def get_result(self, task_id):
def get_task_meta(self, task_id, cache=True):
if cache and task_id in self._cache:
try:
return self._cache[task_id]
return self._cache[task_id]
except KeyError:
#The Backend has been emptied in the meantime
pass
pass # backend emptied in the meantime

meta = self._get_task_meta_for(task_id)
if cache and meta.get("status") == states.SUCCESS:
Expand All @@ -240,10 +239,9 @@ def reload_taskset_result(self, taskset_id):
def get_taskset_meta(self, taskset_id, cache=True):
if cache and taskset_id in self._cache:
try:
return self._cache[taskset_id]
return self._cache[taskset_id]
except KeyError:
#The Backend has been emptied in the meantime
pass
pass # backend emptied in the meantime

meta = self._restore_taskset(taskset_id)
if cache and meta is not None:
Expand Down
1 change: 1 addition & 0 deletions celery/beat.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def next(self, last_run_at=None):
return self.__class__(**dict(self,
last_run_at=last_run_at or datetime.now(),
total_run_count=self.total_run_count + 1))
__next__ = next # for 2to3

def update(self, other):
"""Update values from another entry.
Expand Down
2 changes: 1 addition & 1 deletion celery/datastructures.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def __setitem__(self, key, value):

def pop(self, key, *args):
with self.lock:
self.pop(key, *args)
super(LocalCache, self).pop(key, *args)


class TokenBucket(object):
Expand Down
4 changes: 2 additions & 2 deletions celery/tests/test_app/test_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ def test_conf_property(self):
self.assertEqual(self.loader.conf["foo"], "bar")

def test_import_default_modules(self):
self.assertItemsEqual(self.loader.import_default_modules(),
[os, sys, task])
self.assertEqual(sorted(self.loader.import_default_modules()),
sorted([os, sys, task]))

def test_import_from_cwd_custom_imp(self):

Expand Down
4 changes: 2 additions & 2 deletions celery/tests/test_backends/test_amqp.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ def test_get_many(self):
"traceback": None,
"task_id": uuid})
for i, uuid in enumerate(uuids)]
self.assertItemsEqual(res, expected_results)
self.assertEqual(sorted(res), sorted(expected_results))
self.assertDictEqual(b._cache[res[0][0]], res[0][1])
cached_res = list(b.get_many(uuids, timeout=1))
self.assertItemsEqual(cached_res, expected_results)
self.assertEqual(sorted(cached_res), sorted(expected_results))
b._cache[res[0][0]]["status"] = states.RETRY
self.assertRaises(socket.timeout, list,
b.get_many(uuids, timeout=0.01))
Expand Down
14 changes: 7 additions & 7 deletions celery/tests/test_events/test_events_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ def test_info(self):
received=time() - 10,
started=time() - 8,
succeeded=time())
self.assertItemsEqual(list(task._info_fields),
task.info().keys())
self.assertEqual(sorted(list(task._info_fields)),
sorted(task.info().keys()))

self.assertItemsEqual(list(task._info_fields + ("received", )),
task.info(extra=("received", )))
self.assertEqual(sorted(list(task._info_fields + ("received", ))),
sorted(task.info(extra=("received", ))))

self.assertItemsEqual(["args", "kwargs"],
task.info(["args", "kwargs"]).keys())
self.assertEqual(sorted(["args", "kwargs"]),
sorted(task.info(["args", "kwargs"]).keys()))

def test_ready(self):
task = Task(uuid="abcdefg",
Expand Down Expand Up @@ -278,7 +278,7 @@ def test_clear(self):
def test_task_types(self):
r = ev_snapshot(State())
r.play()
self.assertItemsEqual(r.state.task_types(), ["task1", "task2"])
self.assertEqual(sorted(r.state.task_types()), ["task1", "task2"])

def test_tasks_by_timestamp(self):
r = ev_snapshot(State())
Expand Down
2 changes: 1 addition & 1 deletion celery/tests/test_slow/test_buckets.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def test_items(self):
x.buckets[TaskA.name].put(1)
x.buckets[TaskB.name].put(2)
x.buckets[TaskC.name].put(3)
self.assertItemsEqual(x.items, [1, 2, 3])
self.assertEqual(sorted(x.items), [1, 2, 3])


class test_FastQueue(unittest.TestCase):
Expand Down
4 changes: 2 additions & 2 deletions celery/tests/test_utils/test_utils_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ def test_textindent(self):
def test_format_queues(self):
celery = Celery(set_as_current=False)
celery.amqp.queues = celery.amqp.Queues(QUEUES)
self.assertItemsEqual(celery.amqp.queues.format().split("\n"),
[QUEUE_FORMAT1, QUEUE_FORMAT2])
self.assertEqual(sorted(celery.amqp.queues.format().split("\n")),
sorted([QUEUE_FORMAT1, QUEUE_FORMAT2]))
2 changes: 1 addition & 1 deletion celery/tests/test_worker/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

from celery.tests.compat import catch_warnings
from celery.tests.utils import unittest
from celery.tests.utils import AppCase, skip
from celery.tests.utils import AppCase


class PlaceHolder(object):
Expand Down
4 changes: 2 additions & 2 deletions celery/tests/test_worker/test_worker_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ def test_revoked(self):
state.revoked.add("a2")

try:
self.assertItemsEqual(self.panel.handle("dump_revoked"),
["a1", "a2"])
self.assertEqual(sorted(self.panel.handle("dump_revoked")),
["a1", "a2"])
finally:
state.revoked.clear()

Expand Down
2 changes: 1 addition & 1 deletion celery/utils/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
from ordereddict import OrderedDict # noqa

############## logging.LoggerAdapter ########################################
import logging
Expand Down
1 change: 1 addition & 0 deletions celery/utils/timer2.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def next(self):
self.not_empty.wait(1.0)
return delay
return self.apply_entry(entry)
__next__ = next # for 2to3

def run(self):
try:
Expand Down
10 changes: 10 additions & 0 deletions docs/cookbook/daemonizing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,13 @@ launchd (OS X)

.. _`contrib/mac/`:
http://github.com/ask/celery/tree/master/contrib/mac/


.. _daemon-windows:

Windows
=======

See this excellent external tutorial:

http://www.calazan.com/windows-tip-run-applications-in-the-background-using-task-scheduler/
Binary file removed docs/homepage/bg.png
Binary file not shown.
Binary file removed docs/homepage/bg000000.png
Binary file not shown.
Binary file removed docs/homepage/bg_conte.png
Binary file not shown.
Binary file removed docs/homepage/bg_grass.png
Binary file not shown.
Binary file removed docs/homepage/bg_top00.png
Binary file not shown.
Binary file removed docs/homepage/black_10.png
Binary file not shown.
Loading

0 comments on commit dc92b4d

Please sign in to comment.