Binding to port
jakeboyles opened this issue · 20 comments
I used the deploy to heroku button and am getting a problem with it not being able to bind to port. Am I missing something?
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
Hi jakeboyles - I don't think it should bind to a port - it doesn't provide a web interface.
I didnt think so either but for some reason its crashing my app on heroku
Ah I had this - are you using a free dyno?
I think there's a problem with Heroku where free dynos for nodejs apps can't be of the worker
type.
Thanks for bringing this up - I will investigate now.
Yeah im using the free dyno. I was just going to wrap an express server around it and keep hitting the route with pingdom...
@jakeboyles yeah I actually considered doing that before I upgraded to a hobby dyno (which I was going to do anyway) - seems wasteful but it genuinely seems to be a Heroku limitation/bug.
If you initialise an express server you won't need to pingdom though
Just having it listening is enough
That solved it. So you can use the free dyno you just need to switch your worker.
Interesting, I didn't have the option to do that when I tried - but I'd accidentally initialised the Procfile
with only a web
worker defined so maybe it 'stuck' that way.
Thank you very much for your solution - I'll add it to the README.
If it's non-intuitive, perhaps we could put an small express server there - we could even serve up stats from it...
@chris-j-major that's a good extension, especially if paired with a nice frontend
you could even put Niantic server status there!
@jakeboyles let me know if it works now this is resolved!
Yeah, its working fine now. I think ill still hit the sleeping issue though.
Unless the constant polling of the api solves that, so it might not sleep...
Yeah, I expect you'll just end up using up your free dyno hours while the app is running.