Author Topic: Task Manager Configuration  (Read 2368 times)

Offline dhigz

  • Newbie
  • *
  • Posts: 45
  • Karma: +16/-0
    • View Profile
Task Manager Configuration
« on: November 01, 2020, 03:33:56 PM »
Hi,

Working on a new extension that requires the creation and execution of two tasks. This is the first time I have created a task and I understand the idea is to call the task.php file by way of Crontab which will then run all of the tasks in the tasks in the tasks table. My question concerns the frequency of each task.

One of my new tasks need to run every hour while the other needs to run once a day. Reading the documentation and looking at the existing tasks, there are no examples of setting different run times. I do see the 'run_interval' value in the addTask array but this is described as "interval in seconds since last run" in the documentation.

How do you suggest I solve my problem with two tasks to be run at different run times?

Don
Don Higbee

Offline dvagner

  • Core/UI Developer
  • Jr. Member
  • **
  • Posts: 73
  • Karma: +28/-1
    • View Profile
Re: Task Manager Configuration
« Reply #1 on: November 02, 2020, 04:13:50 AM »
You can add 2 different tasks and run it from cron as 2 record in cron

php task_cli.php run --task_id=1 --force
php task_cli.php run --task_id=2 --force
....

Offline maxter

  • Full Member
  • ***
  • Posts: 228
  • Karma: +64/-0
    • View Profile
Re: Task Manager Configuration
« Reply #2 on: November 02, 2020, 06:21:17 AM »

Offline dhigz

  • Newbie
  • *
  • Posts: 45
  • Karma: +16/-0
    • View Profile
Re: Task Manager Configuration
« Reply #3 on: November 02, 2020, 12:17:18 PM »
Thanks dvagner.

I will give it a try.

Don Higbee

 

Powered by SMFPacks Social Login Mod