How to stop a running php process on heroku server?

156 views Asked by At

I have written a slack auto-message service on heroku that will auto send a message on some event. However, I have accidentally made an infinity loop and it keeps sending error message to my slack account. (the loop caused by retrying on error and I forgot to add a counter on that)

I have tried restarting the server by typing the command heroku restart (at that directory, so app name can be omitted), as well as git pushing my corrected version which should restart the server. I even turn off the server by settings 0 dymo to it. None of these works and I still keep receiving message on slack.

I am quite sure I have turn off my heroku server, so I think there should be other way to stop the process. The php process will have a bash_exec to trigger phantomjs. Not sure if it is related to the current problem. Do anyone has any suggestions?

P.S. As request, this is my code with important information hidden.

<?php
sendSlackMessageToChannel("Request received. Loading, please wait.");
startPhantomJS();
function startPhantomJS() {
    $return_value = bash_exec("path/to/phantomjs myscript.js");
    sendSlackMessageToMyself($return_value);
    if ($return_value == "error")
        startPhantomJS();
    else
        sendSlackMessageToChannel($return_value);
}
0

There are 0 answers