celery-slack
celery-slack copied to clipboard
Allow change username & ignore certain exceptions
- You can add
show_custom_username=True
when instantiatingSlackify
to send messages with a custom username. By default useshostname@task_name
. It can be overrided passing ausername
kwarg toSlackify
. In the context of startup/shutdown messages there is not any task name so we will usecelery
by default, it can be overriden passingservice_name
kwarg toSlackify
. - Now you can silent certain exceptions using the
ignore
decorator like this:
from . import app
from slackify import ignore
from blah.exceptions import Timeout
from abc.exceptions import AwesomeException
@app.task(name="some_task")
@ignore(Timeout, AwesomeException)
def some_task(): pass
closes #8 closes #10
Hey @palvarezcordoba sorry for letting this fall through the cracks. I should have some time this weekend to go over this. Should I close the previous PR and consider this one instead?
@crflynn I've closed it.
This is the good PR. Here I don't use tricks involving inspect.trace
.
I haven't written the tests yet.
Hey I think these are good features to include. I could help write the tests out if you'd like to collaborate on this.