paint-brush
Prevent Your Free Heroku Dyno from Sleeping by@fermentationist
9,034 reads
9,034 reads

Prevent Your Free Heroku Dyno from Sleeping

by fermentationist6mOctober 5th, 2019
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Free Heroku dyno will take a nap whenever it has gone for thirty minutes or more without web traffic. Nodejs is easy to keep your dyno awake with just a few lines of code. I used Node's setTimeout function to make an HTTP request to my app at regular intervals of less than thirty minutes, thus keeping the dyno from snoozing. This will do the trick of rousing a sleepy dyno, but unlike using setInterval, it will only run once.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Prevent Your Free Heroku Dyno from Sleeping
fermentationist HackerNoon profile picture
fermentationist

fermentationist

@fermentationist

JavaScript Developer. I love to build things, in code and otherwise. I also brew a righteous Kölsch.

Learn More
LEARN MORE ABOUT @FERMENTATIONIST'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

fermentationist HackerNoon profile picture
fermentationist@fermentationist
JavaScript Developer. I love to build things, in code and otherwise. I also brew a righteous Kölsch.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite