| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 34 | public function actionWatch() |
||
| 35 | { |
||
| 36 | Craft::log(Craft::t('Watching for new tasks.')); |
||
| 37 | |||
| 38 | // Keep on checking for pending tasks |
||
| 39 | while (true) { |
||
| 40 | |||
| 41 | // Reset next pending tasks cache |
||
| 42 | $this->resetCraftNextPendingTasksCache(); |
||
| 43 | |||
| 44 | // Start running tasks |
||
| 45 | craft()->tasks->runPendingTasks(); |
||
| 46 | |||
| 47 | // Sleep a little |
||
| 48 | sleep(craft()->config->get('taskInterval')); |
||
| 49 | } |
||
| 50 | } |
||
| 51 | |||
| 64 |