Installation
1. Install this to make the testing easier:
https://github.com/catalyst/moodle-tool_testtasks
|
2. Clear adhoc task queue:
php admin/tool/testtasks/cli/clear_adhoc_task_queue.php
|
3. Generate 20 tasks:
php admin/tool/testtasks/cli/queue_adhoc_tasks.php -d=1 -n=20
|
Limit by task_adhoc_concurrency_limit
1. Set task_adhoc_concurrency_limit to 0:
php admin/cli/cfg.php --name=task_adhoc_concurrency_limit --set=0
|
2. Set task_adhoc_max_runtime to 10:
php admin/cli/cfg.php --name=task_adhoc_max_runtime --set=10
|
3. Execute adhoc_task.php:
php admin/tool/task/cli/adhoc_task.php --execute
|
4. Confirm, that "Skipping processing of adhoc tasks. Concurrency limit reached." message is displayed.
Limit by task_adhoc_max_runtime
1. Set task_adhoc_concurrency_limit to 3:
php admin/cli/cfg.php --name=task_adhoc_concurrency_limit --set=3
|
2. Set task_adhoc_max_runtime to 0:
php admin/cli/cfg.php --name=task_adhoc_max_runtime --set=0
|
3. Execute adhoc_task.php:
php admin/tool/task/cli/adhoc_task.php --execute
|
4. Confirm, that "Stopping processing of adhoc tasks as time limit has been reached." is displayed.
Unlimited run
1. Set task_adhoc_concurrency_limit to 0:
php admin/cli/cfg.php --name=task_adhoc_concurrency_limit --set=0
|
2. Set task_adhoc_max_runtime to 0:
php admin/cli/cfg.php --name=task_adhoc_max_runtime --set=0
|
3. Execute adhoc_task.php without limits:
php admin/tool/task/cli/adhoc_task.php --execute --ignorelimits
|
4. Confirm, that all remaining 20 tasks were executed:
Ran 20 adhoc tasks found at <date and time>
|
Limit by task_adhoc_max_runtime with keep-alive mode
1. Set task_adhoc_concurrency_limit to 3:
php admin/cli/cfg.php --name=task_adhoc_concurrency_limit --set=3
|
2. Set task_adhoc_max_runtime to 5:
php admin/cli/cfg.php --name=task_adhoc_max_runtime --set=5
|
3. Execute adhoc_task.php:
php admin/tool/task/cli/adhoc_task.php -e -k=10
|
4. Confirm, that it sits there waiting and drawing dots every second:
Waiting for more adhoc tasks to be queued ....
|
5. Confirm, that after 5 seconds it exits and the following message is displayed:
Stopping processing of adhoc tasks as time limit has been reached.
|
Unlimited run with keep-alive mode
1. Set task_adhoc_concurrency_limit to 3:
php admin/cli/cfg.php --name=task_adhoc_concurrency_limit --set=3
|
2. Set task_adhoc_max_runtime to 5:
php admin/cli/cfg.php --name=task_adhoc_max_runtime --set=5
|
3. Execute adhoc_task.php:
php admin/tool/task/cli/adhoc_task.php -e -i -k=10
|
4. Confirm, that it sits there waiting and drawing dots every second:
Waiting for more adhoc tasks to be queued ....
|
5. Confirm, that after 10 seconds it exits.