Details
Description
Some tasks can take a long time to run, and then they hold up other tasks from completing. If a company could specify which tasks to run in the cron command, they could create multiple cron commands that do not overlap. For example, auto-debit or invoice creation could run on their own if they take a long time, while all other tasks could run on a normal schedule.
There are several ways to do this, and they all involve passing in the task names or ID's as a parameter in the cron command:
/index.php cron TASKS
One suggestion is to use JSON and have both an include and exclude option. Run only these tasks, or run all tasks except these tasks.
Process all except for createInvoices and deliverInvoices
index.php cron '{"exclude":["create_invoice","deliver_invoices"]}' > /dev/null 2>&1
Process only createInvoices and deliverInvoices
index.php cron '{"include":["create_invoice","deliver_invoices"]}' > /dev/null 2>&1
A single task processes for all companies, I don't know if we want to make any special considerations for companies, I'm leaning toward not now.
NOTE: Module and plugin tasks could have the same key in cron_tasks as a core task or another extension so it may be necessary to specify the task_type (module, plugin) if it's not system. Or, we can just ignore the type (system, module, plugin) and run all with that name, or exclude all with that name... maybe we should do that to start with.