Skip to content
Advertisement

Heroku Java application timing out after 90 seconds

I have been trying to host a discord bot on heroku for some time now. I Have everything set up now but the connection keeps timing out after 90 seconds because it cannot sustain a connection and I am not sure what is wrong.

Procfile: web: java $JAVA_OPTS -Dserver.port=$PORT -cp target/classes:target/dependency/* com.marcuzzo.JDABot.Bot

Error log:

JavaScript

I have been told to change the dyno in my procfile to anything OTHER then web but while the build succeeds, the bot never goes online if I were to use something like bot.

This post tells me to call a listen() method but I think this was either written for python or it is part of a library I do not know about.

My application is pretty short considering I am just focused on getting it hosted:

JavaScript

I am not sure if there is a certain method in the JDA library I am using that would solve this problem but I have not found any so far.

Advertisement

Answer

Looks like your bot is not web app. You should use worker heroku configuration. Please check https://devcenter.heroku.com/articles/run-non-web-java-processes-on-heroku

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement