These tasks can be of two types - with immediate execution and deferred.
Each task has its own properties, which are stored in a database table tasks.
These properties include:
name - a unique name for the job
starter - user_id of the user who has the right to run the task (top-administrator has it always)
status - status
start_time - task start time
last_time_run - the last task start
progress - the percentage of completion
last_result - 0 - success, 1 - failed
run_interval - start task interval in seconds.
max_execution_time - the maximum duration of the task (not available yet)
The table is also used for the extended properties task_details in which:
Each task consists of steps. A description of each step is stored in the database table task_steps. As the task, each step has a status sequence number, the last run time, and a result. In addition, the table must specify RT controller performing step. For example: task / tool / backup / backupfiles
Also in the table present the settings column in which should be recorded the serialized array. This array can be as arguments to functions and additional information on the launch step. For example, interrupt_on_step_fault set to true or 1 will stop the execution of the remaining steps of the job if the execution of the step failed.
In cases where the execution of at least one of the listed task steps fails, the task is generally considered a failed. In other words, successfully completed task, this task is complete all the steps successfully.
Running tasks can occur in two ways.
Console launch script task.php (from cron). task.php receive a list of all waiting tasks, then sort all in order and run in the background
The launch of the UI (meaning immediately start the event, such as clicking a button).
Functions hang an event on an element with the css-class "task_run". Also, this element must be two custom attribute: data-run-task-url (url to which js-script gets the job description and all the steps in the json-format to run in a loop) and data-complete-task-url - URL, which will be forwarded to the browser after the successful completion of the task.
As an example of creating and launching an urgent job, see the button. Admin → Data → Backup → “Backup now”.
To see examples of the data in the database tables described above, click Admin → Data → Backup → "Schedule backup".
Scheduling tasks and running the command line
If you like to process tasks on the background of your server, you need to have access to your server shell or the ability to set up crontab.
In the shell, you need to go to the AbanteCart directory (same director with index.php)
Run this command.