Skip to content

Commit

Permalink
Cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed May 17, 2012
1 parent 929405e commit e6c19ad
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions celery/app/amqp.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def __init__(self, channel=None, exchange=None, *args, **kwargs):
if not isinstance(exchange, Exchange):
exchange = Exchange(exchange,
kwargs.get("exchange_type") or self.exchange_type)
self.queues = self.app.amqp.queues # shortcut
super(TaskProducer, self).__init__(channel, exchange, *args, **kwargs)

def delay_task(self, task_name, task_args=None, task_kwargs=None,
Expand Down Expand Up @@ -190,14 +191,12 @@ def delay_task(self, task_name, task_args=None, task_kwargs=None,
if chord:
body["chord"] = chord

print("KWARGS: %r" % (kwargs, ))

self.publish(body, exchange=exchange, mandatory=mandatory,
immediate=immediate, routing_key=routing_key,
serializer=serializer or self.serializer,
compression=compression or self.compression,
retry=retry, retry_policy=_rp, delivery_mode=delivery_mode,
declare=[self.app.amqp.queues[queue]] if queue else [],
declare=[self.queues[queue]] if queue else [],
**kwargs)

signals.task_sent.send(sender=task_name, **body)
Expand Down
2 changes: 1 addition & 1 deletion celery/backends/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def wait_for(self, task_id, timeout=None, propagate=True, interval=0.5):

time_elapsed = 0.0

while True:
while 1:
status = self.get_status(task_id)
if status == states.SUCCESS:
return self.get_result(task_id)
Expand Down
2 changes: 1 addition & 1 deletion celery/concurrency/processes/_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def get_processtree_pids(pid, include_parent=True):
parents = get_all_processes_pids()
all_pids = parents.keys()
pids = set([pid])
while True:
while 1:
pids_new = pids.copy()

for _pid in all_pids:
Expand Down
2 changes: 1 addition & 1 deletion celery/events/cursesmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def readline(self, x, y):
curses.echo()
try:
i = 0
while True:
while 1:
ch = self.win.getch(x, y + i)
if ch != -1:
if ch in (10, curses.KEY_ENTER): # enter
Expand Down
2 changes: 1 addition & 1 deletion celery/schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def day_out_of_range(year, month, day):
return False

def roll_over():
while True:
while 1:
flag = (datedata.dom == len(days_of_month) or
day_out_of_range(datedata.year,
months_of_year[datedata.moy],
Expand Down
1 change: 0 additions & 1 deletion celery/worker/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ def _eventloop(self):
else:
sleep(min(time_to_sleep, 1))


def on_task(self, task):
"""Handle received task.
Expand Down

0 comments on commit e6c19ad

Please sign in to comment.