fdocr / martilla

Easy to configure DB backup tool for simple everyday use on UNIX based systems
https://visualcosita.com/martilla-tool-for-db-backups/
MIT License
10 stars 4 forks source link

Add on_failure and on_success options for slack notifier #9

Closed ewelinasobora closed 4 years ago

ewelinasobora commented 4 years ago

It may fix #7

fdocr commented 4 years ago

Hello @ewelinasobora, first of all thank you for taking the time to help out with the project!

This is not exactly the fix I had in mind though. In the issue there was a link to the base Notifier class, this is where I would expect two methods maybe called send_success? and send_failure?

Check out this method from another PR, this is how we get the options from the config file (with a default value of true for this case)

Then finally in the Backup class notifier.error(e.message, metadata) if notifier.send_failure? is what I believe would stitch everything together (and of course the same for success notifications.

Hope this helps you out and thanks again for investing the time!

fdocr commented 4 years ago

The feature was implemented so I'm closing the PR. Thanks again for taking interest in the project @ewelinasobora, if you're ever interested in collaborating again feel free to reach out and I'll be happy to help!