0

I have a followup question from this one. So, I'm using HangFire to run recurring jobs from a dummy webform on a shared server (somee.com). But I discovered that the IIS goes idle in x minutes, so my jobs are never executed (I mean they are only executed when the IIS is active).

So, is there any way to keep it alive? As it is a shared server I don't exactly have access to its configuration. I've read that having a service ping the website would do the trick. I've tried with uptimerobot but didn't have any luck. It still goes to sleep...

Any ideas?

taiko
  • 458
  • 6
  • 22
  • `It still goes to sleep` Normally, ping request to server every 5 minutes should keep the server alive, unless the server crashes before next ping request. – Win Aug 22 '17 at 23:10
  • Hm... I'm testing on database insertion, inserting datetime.utcnow. I can get 2, maybe 3 insertions, and then they stop. It suggests that it's not doing what it was supposed to. I'm trying http requests from uptimerobot as well. Let's see what happens. – taiko Aug 22 '17 at 23:18
  • Yeah, neither worked. Supposedly, the ping would have worked. And I guess http would too. I don't know why but for some reason they don't... I can see that the hangfire tables are created on startup and it makes insertions just fine for about 20 minutes or so. And then it dies out... Any ideas? I mean, any idea, as long as I can solve this annoying problem. I even thought of creating a RESTfull Web API instead, but it would mean that it would be simply waiting for a request to be made. – taiko Aug 23 '17 at 01:14

1 Answers1

0

So, I managed to solve it. I asked for help on the HangFire forums and finally did it. Here's the link to the post: https://discuss.hangfire.io/t/keep-alive-on-shared-server/3723

TL;DR: Basically, I'd tried ping and HTTP requests with uptimerobot and they didn't work for me. What did was their Keyword requests. And now I have a windows scheduler simulated service. :)

Visit the HangFire forums for details.

taiko
  • 458
  • 6
  • 22