Need job scheduler in asp.net

后端 未结 9 2158
無奈伤痛
無奈伤痛 2021-02-03 14:01

We have a website where we need a scheduler to receive notifications (e-mail) on specific time. eg. a person setting reminder at 5 PM to attend the meeting at 4:45 PM, will rece

9条回答
  •  有刺的猬
    2021-02-03 14:58

    If you really have no control over the server (meaning, you cannot use an sql job, a scheduled task, or install a windows server) then you could use a System.Threading.Timer that you initialize in your Global.asax (e.g, on application startup) that invokes a certain method in your application every x minutes. This method would then query your database and see what notifications need to be send.

    This is really not a desirable approach though, as the timer is not guaranteed to always invoke as far as I know, since, like Peter says, your web application is not guaranteed to be alive at all times.

    However, depending on your requirements, it can still be a 'good enough' approach if you have no other options.

提交回复
热议问题