Forums

How to stop app web?

I just wanted to see, what if I add while True in code. I added this:

while True:
    bot.send_message(100310279, 'hook')
    time.sleep(1.5)

and then I even remove all code from file, but it still working. I can't reload it. what I have to do?

Webapps really don't like infinite loops. I've cleared out the processes that were stuck, so your web app should be back to normal now.

oh... thanks. actually, I have threading in my code. I have to remove it, right? I supposed, it can happen again. what should I do in this case?

Yeah. Threads will just not start in a web app. If you get your web app stuck again, just contact support and we'll deal with it.

okay... well, my bot do something every minute, what I have to take? cron? I heard, I can't use cron on python anywhere from someone... also, I want to add something like alarm or timer

Your best bet is to use a scheduled task -- though free accounts only support one task, once a day, so you'd need to upgrade in order to run something more frequently than that.