P
P
password222021-10-19 19:19:01
ASP.NET
password22, 2021-10-19 19:19:01

How to implement a request to api clearly in time?

Good evening. I need to send a request every 5 minutes and 10 seconds (21:05:10, 21:10:10, 21:15:10) and write the received data to the database.

I have already implemented this through quartz, but several problems pop up at once.

  1. I achieved a clear schedule of 5 minutes and 10 seconds through the cron expression, but it turned out that in vs everything works fine, but when uploaded to the hosting, this expression is unreadable, sort of with an error. I've tried every possible way to build the correct cron expression, but to no avail.


  2. Next problem. Quartz doesn't start the task at all if I specify StartAt()


  3. Further. On hosting, quartz is unstable, it stops performing the task, then continues, and so on all the time. (The site I made for myself, there is no constant traffic to it). And as I understood this because of iis timeout, I did not find how to remove it. Hosted the site on somee com, free hosting.




I hope someone will tell you at least where to dig ... or an alternative

Thank you

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Voland69, 2021-10-20
@Voland69

Try to use IHostedService , it is just designed to perform tasks on a timer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question