Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow change username & ignore certain exceptions #18

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

palvarezcordoba
Copy link

@palvarezcordoba palvarezcordoba commented Sep 26, 2019

  • You can add show_custom_username=True when instantiating Slackify to send messages with a custom username. By default uses hostname@task_name. It can be overrided passing a username kwarg to Slackify. In the context of startup/shutdown messages there is not any task name so we will use celery by default, it can be overriden passing service_name kwarg to Slackify.
  • 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

crflynn and others added 3 commits July 9, 2019 21:53
* poetry; black; pytest; travis

* fix python version

* dist xenial

* limit black python version

* update deps for 2.7

* conditional black run

* try n=4 again

* history and cache dir

* add which python

* debug

* install poetry differently

* fix spacing

* n=8 gives no benefit

* remove ls

* fix

* revert poetry install

* print sys exec

* rm source

* add venvs

* try unset venv

* unset

* remove legacy files; update metadata

* add classifiers

* clean up black config

* add keywords

* fix readme

* remove tox
@crflynn
Copy link
Owner

crflynn commented Sep 27, 2019

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?

@palvarezcordoba
Copy link
Author

@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.

@crflynn
Copy link
Owner

crflynn commented Oct 13, 2019

Hey I think these are good features to include. I could help write the tests out if you'd like to collaborate on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow exclude some Exceptions from celery-slack Add hostname to message
2 participants