Support for running a task regularly?

Enonic version: 6.12
OS: Windows 10

I am working on a xp app that needs to perform a task in the background at regular intervals. It doesn’t look like the task lib supports submitting a task with an interval or anything like that.

What is the “best practice” code approach for running a js task, lets say every minute or every 5 minutes?

I would prefer to not depend on having a different app installed for my app to work.

1 Like

Now you can declare tasks in a xml file with parameters and its own names (just like a service) and then you can set up a cron job and inside of it run “submitNamed” function of the tasklib :slight_smile:

http://repo.enonic.com/public/com/enonic/xp/docs/6.12.0/docs-6.12.0-libdoc.zip!/module-task.html#.submitNamed

1 Like

Hi Espen,

Enonic uses the cronjob app from Market successfully in multiple projects to do this. In the future we will build something the Job scheduler from good-old Enonic CMS.

1 Like

Can I make the cronjob app a gradle dependency in my my app, so I am sure that it is available when someone installs my app, or will I have to specify in the “Installation” part of a readme that whoever installs my app will also have to install the cronjob app ?