Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • DJBoeren 4 posts 34 karma points
    Nov 15, 2015 @ 17:46
    DJBoeren
    0

    Scheduled task won't run

    Hi all,

    wondering if I'm doing something wrong. I'm new to the task scheduler (and fairly new to Umbraco in general) and I'm wondering if there's something I'm missing.

    I've created an API controller which contains a method in which I perform a couple of node lookups and deletes (specific content types that are marked for deleteion). Just included the header for reference, if anyone needs more info I'll add it.

        [HttpGet]
        public string CheckAndDeleteExpiredEvents()
        {
           ....
        {
    

    Now I want to schedule this method to run every 60 minutes (currently every minute for development purposes). I've modified the scheduledTasks section in config\umbracoSettings.config the following way:

    <scheduledTasks>
    <!-- add tasks that should be called with an interval (seconds) -->
    <!--    <task log="true" alias="test60" interval="60" url="http://localhost/umbraco/test.aspx"/>-->
    <task log="true" alias="DeleteExpiredEvents" interval="60" url="http://website.local/umbraco/api/ContentApi/CheckAndDeleteExpiredEvents"/>
    

    (there's a scheduledTasks closing tag but the code sample seems relucatant to show it)

    I've edited the web.config and also restarted the application pool, but it won't run my task. Calling this URL manually does exactly what the method should do and I confirmed there are no exceptions (and now I see some of my own logging from the method in the Umbraco logs). I've checked the logs some further and could find no entries of even trying to run my task, even after an hour of waiting (saw a couple of posts where people suggested it could take a while for the scheduler to intially "kick in").

    It seems it just doesn't register my task as far as I can tell cause logging was set to true for the task and it doesn't even generate an error mentioning it. Am I missing something somewhere?

    Umbraco version is 7.2.5 btw.

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Nov 15, 2015 @ 18:53
    Nicholas Westby
    100

    Seems to be a bug in Umbraco 7.2.5 (the version you are running):

    Try upgrading. It may be fixed in 7.2.6, though I recall some serious issues in that Umbraco version, so I'd recommend at least Umbraco 7.2.8. You could also upgrade to the latest (7.3.1).

  • DJBoeren 4 posts 34 karma points
    Nov 16, 2015 @ 10:33
    DJBoeren
    0

    Thanks for your reply, I will try updating and see if that solves anything!

    Edit: we've put the upgrade on hold for a while to investigate in other options. There's just too many issues with other packages when upgrading to MVC5 currently so I will need to pick a better moment for it, when time is more plentiful ;)

    Edit2: btw you need Umbraco 7.3.0 mininum, according to the changelogs it is not solved in any 7.2.x version.

    Edit3: since upgrading was causing too many issues with several used components, we've opted for a workaround and set up a job in Azure that calls the API URL.

Please Sign in or register to post replies

Write your reply to:

Draft