-
Notifications
You must be signed in to change notification settings - Fork 2
Testing and debugging
Always develop and test your code independently from Tasker until it is ready to be taskified.
Tasker should save every notices, errors etc. into $task->log_messages.
It even has an independent "debug" setting that controls this logging.
It also has its own exception, error and signal handlers to catch and handle as many errors as possible.
When you execute tasks using TaskerAdmin its Javascript frontend communicates with its backend API using JSON objects.
If you see "Parse errors" on this interface it means that the JSON object is not well formed, Tasker failed to execute your task (e.g. due to a syntax error). In this case you should reset the task manually (including resetting the running status to 0) and then check the raw results coming back from the API. To do this just add "api/" to the end of the TaskerAdmin URL (before the id and cmd arguments), and see what it produces.
Example:
https://example.org/processwire/page/tasks/api?id=60343&cmd=exec
It may display "PHP: Warning ...." or other messages.
Again: it is always a good idea to finalize your app before using Tasker to execute it.
The module contains a basic profiler (from version 0.9.5) to check how your import routine is making progress and to help in finding slow code fragments. It gives you timestamps that you can print out. E.g.
$this->message($tasker->profilerGetTimestamp()."Processing data for field '{$field}'.", Notice::debug);will look like
[2.34] Processing data for field 'event_type'.
Tasker tries to reconnect to the DB during task execution, but it is a good idea to check and increase wait_timeout in your MySQL config to match the execution time of your longest task.