2 years ago
Having an issue where my project is running twice. I've ran it on my computer and it runs once. Dont know what to do from here
50 Replies
2 years ago
what makes you think it's running twice?
2 years ago
where does private networking come into this issue?
I dont know I just thought It would fix something. Again I've ran the code on my computer and it ran once
2 years ago
what makes you think it's running twice on railway?
2 years ago
I'm not sure what I can do for you here if you don't know what the issue is
The issue is that its starting twice. I'm not sure what else you want me to say?
2 years ago
what makes you think it's starting twice?
2 years ago
what about railway?
Idk what do you want me to say if you're just gonna keep asking me the same question when I am giving you an answer
2 years ago
you are not answering the question, you claim it's running twice, what has made you come to that conclusion?
2 years ago
are there anything in the logs that would indicate it's running twice
Didn't understand the question earlier sorry about that. But yeah, heres the instance logging in twice in railway

2 years ago
are you running two replicas?
2 years ago
do you know what a replica is?
2 years ago
are you using nixpacks or a dockerfile
2 years ago
build logs please -
2 years ago
deploy logs please
2 years ago
how do you start the bot locally
Just running python3 main.py
2 years ago
send the main.py file
Alright, just hope you are ready for the spaghetti mess I call code
2 years ago
youre running a flask app that is starting two processes, thus starting two bots
2 years ago
you where using environment variables for the discord token, do the same for the database too haha
2 years ago
you will also need to be using gunicorn for a flask app, but you still need to fix the underlying code issue first
2 years ago
yes
2 years ago
you are currently running flask in development mode, and while thats not the main issue, it is still an issue
2 years ago
make sure you are now using gunicorn too
2 years ago
as your logs have said -
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.2 years ago
sounds good
