Skip to content

Commit

Permalink
Merge branch 'master' of github.com:celery/celery
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Jun 19, 2015
2 parents 377178c + 6bf4664 commit 2fcee73
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 4 deletions.
1 change: 1 addition & 0 deletions celery/app/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ def mail_admins(self, subject, body, fail_silently=False):
timeout=conf.EMAIL_TIMEOUT,
use_ssl=conf.EMAIL_USE_SSL,
use_tls=conf.EMAIL_USE_TLS,
charset=conf.EMAIL_CHARSET,
)

def select_queues(self, queues=None):
Expand Down
1 change: 1 addition & 0 deletions celery/app/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ def __repr__(self):
'TIMEOUT': Option(2, type='float'),
'USE_SSL': Option(False, type='bool'),
'USE_TLS': Option(False, type='bool'),
'CHARSET': Option('us-ascii'),
},
'SERVER_EMAIL': Option('celery@localhost'),
'ADMINS': Option((), type='tuple'),
Expand Down
5 changes: 3 additions & 2 deletions celery/loaders/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,11 @@ def getarg(arg):
def mail_admins(self, subject, body, fail_silently=False,
sender=None, to=None, host=None, port=None,
user=None, password=None, timeout=None,
use_ssl=False, use_tls=False):
use_ssl=False, use_tls=False, charset='us-ascii'):
message = self.mail.Message(sender=sender, to=to,
subject=safe_str(subject),
body=safe_str(body))
body=safe_str(body),
charset=charset)
mailer = self.mail.Mailer(host=host, port=port,
user=user, password=password,
timeout=timeout, use_ssl=use_ssl,
Expand Down
7 changes: 7 additions & 0 deletions celery/tests/worker/test_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ def se(*args, **kwargs):
c.start()
sleep.assert_called_with(1)

def test_no_retry_raises_error(self):
self.app.conf.BROKER_CONNECTION_RETRY = False
c = self.get_consumer()
c.blueprint.start.side_effect = socket.error()
with self.assertRaises(socket.error):
c.start()

def _closer(self, c):
def se(*args, **kwargs):
c.blueprint.state = CLOSE
Expand Down
4 changes: 4 additions & 0 deletions celery/worker/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ def start(self):
try:
blueprint.start(self)
except self.connection_errors as exc:
# If we're not retrying connections, no need to catch
# connection errors
if not self.app.conf.BROKER_CONNECTION_RETRY:
raise
if isinstance(exc, OSError) and exc.errno == errno.EMFILE:
raise # Too many open files
maybe_shutdown()
Expand Down
9 changes: 9 additions & 0 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1633,6 +1633,15 @@ to the SMTP server when sending emails.
The default is 2 seconds.
EMAIL_CHARSET
~~~~~~~~~~~~~
.. versionadded:: 3.2.0
Charset for outgoing emails. Default is "us-ascii".
.. setting:: EMAIL_CHARSET
.. _conf-example-error-mail-config:
Example E-Mail configuration
Expand Down
2 changes: 1 addition & 1 deletion docs/django/first-steps-with-django.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ concrete app instance:
Using the Django ORM/Cache as a result backend.
-----------------------------------------------

The ``django-celery`` library defines result backends that
The [``django-celery``](https://github.com/celery/django-celery) library defines result backends that
uses the Django ORM and Django Cache frameworks.

To use this with your project you need to follow these four steps:
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ What do I need?
.. sidebar:: Version Requirements
:subtitle: Celery version 3.0 runs on

- Python ❨2.5, 2.6, 2.7, 3.2, 3.3❩
- Python ❨2.5, 2.6, 2.7, 3.2, 3.3, 3.4
- PyPy ❨1.8, 1.9❩
- Jython ❨2.5, 2.7❩.

Expand Down
3 changes: 3 additions & 0 deletions extra/supervisord/celery.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
source {{ additional variables }}
exec celery --app={{ application_name }}.celery:app worker --loglevel=INFO -n worker.%%h
5 changes: 5 additions & 0 deletions extra/supervisord/celeryd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
; Set full path to celery program if using virtualenv
command=celery worker -A proj --loglevel=INFO

; Alternatively,
;command=celery --app=your_app.celery:app worker --loglevel=INFO -n worker.%%h
; Or run a script
;command=celery.sh

directory=/path/to/project
user=nobody
numprocs=1
Expand Down

0 comments on commit 2fcee73

Please sign in to comment.