Skip to content
This repository has been archived by the owner on Apr 5, 2018. It is now read-only.

Commit

Permalink
Added the ability to control the watch interval
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Olde Hampsink committed Apr 4, 2016
1 parent bbc608f commit 236506a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ phpunit --bootstrap craft/app/tests/bootstrap.php --configuration craft/plugins/

Changelog
=================
###0.4.1###
- Added the ability to control the watch interval via the `taskInterval` config setting

###0.4.0###
- Added the ability to run and watch for tasks via the command line.

Expand Down
2 changes: 1 addition & 1 deletion TaskManagerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function getDescription()
*/
public function getVersion()
{
return '0.4.0';
return '0.4.1';
}

/**
Expand Down
21 changes: 21 additions & 0 deletions config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Craft;

/**
* Task Manager.
*
* @author Bob Olde Hampsink <[email protected]>
* @copyright Copyright (c) 2015, Bob Olde Hampsink
* @license MIT
*
* @link http://github.com/boboldehampsink
*/
return array(

// How long should we wait before we forfeit a task as hanging?
'taskTimeout' => 0,

// At what interval should the watcher watch for new tasks? (in seconds)
'taskInterval' => 10
);
2 changes: 1 addition & 1 deletion consolecommands/TaskManagerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function actionWatch()
craft()->tasks->runPendingTasks();

// Sleep a little
sleep(10);
sleep(craft()->config->get('taskInterval'));
}
}

Expand Down

0 comments on commit 236506a

Please sign in to comment.