Search code examples
heroku

Why my trading bot is being restarting after I made a sys exit on my python module?


I want just 1 trade open at a time. But Heroku force my bot to open another trade each time my bot "crashes" because Heroku restarting my bot again.

How can avoid this and "tell" Heroku to doing nothing if I already have an open trade?

I had to turn off the web dynos enter image description here


Solution

  • This is not Heroku's fault. Heroku will always try to keep you application up, that's the deal with using such services. So if it crashes, it will restart.

    You should check on your own application to only open a trade if there isn't one already.