Application starting twice

Hello, i have a simple python script.

main.py

import requests
from time import sleep

def main():

    while True:
        ... code ...

        sleep(60)
   

if __name__ == '__main__':
    main()

When i start the server in render it seems that the application is running twice for some reason. I can see that since the code send some notifications and i’m recieven the notifications twice.

Also it seems the status is always deploying in progress.

Any idea what i’m doing wrong? Im pretty new at cloud servers

These are the service settings

Hi,

It looks like you’re trying to run a script on a Web Service.

If you just want to run a script, and not a web server, you’d be better with a Background Worker

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.