1
votes

I have a scheduled task that I want to run every 5 minutes.

I added the url for my method in umbracoSettings.config and the necessary settings but scheduledTasks doesn't seem to be running.

I tried debugging it by calling the url from the browser and I do hit my break point.

I tried checking the logs but there are no errors being recorded. Is this a bug in umbraco? How can I know that the scheduled task is running?

  <scheduledTasks>
    <!-- add tasks that should be called with an interval (seconds) -->
    <task log="true" alias="task1" interval="300" url="http://localhost:43203/umbraco/api/Integration/Init"/>
  </scheduledTasks>

I'm using Umbraco 7.5.8

I never had trouble using scheduledTasks in other versions of Umbraco.

2

2 Answers

0
votes

The main issue I've seen with scheduled tasks is when the server that's running can't resolve the address in the task. Sometimes a server can be so locked down it can't actually "see" itself, so it can't get to the URL to run it. If this was the case though, you'd normally see some errors in the Umbraco TraceLog file in /App_Data/Logs/.

If your breakpoint isn't getting hit, you could try adding some logging code to the method you're calling and see if that gets written to the Umbraco log files? That way you should be able to tell if it's being hit or not.

0
votes

Its working now. if you look at umbracoServer table in the database you will see a column isMaster.

The scheduledTasks is only running on the master server.