-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from gyselroth/dev
Dev
- Loading branch information
Showing
26 changed files
with
44 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ $header = <<<'EOF' | |
TaskScheduler | ||
@author Raffael Sahli <[email protected]> | ||
@copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
@copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
@license MIT https://opensource.org/licenses/MIT | ||
EOF; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
## 3.0.2 | ||
**Maintainer**: Raffael Sahli <[email protected]>\ | ||
**Date**: Mon Jan 28 12:18:34 CET 2018 | ||
|
||
* [CHANGE] Set intial datetime (not 0), writer worker caught exception: 10003 Cannot change the size of a document in a capped collection #15 | ||
|
||
|
||
## 3.0.1 | ||
**Maintainer**: Raffael Sahli <[email protected]>\ | ||
**Date**: Thu Jan 25 17:29:34 CET 2018 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
@@ -36,7 +36,6 @@ interface JobInterface | |
self::STATUS_TIMEOUT => 'timeout', | ||
]; | ||
|
||
|
||
/** | ||
* Get job data. | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
@@ -64,7 +64,7 @@ class Queue | |
protected $manager_pid; | ||
|
||
/** | ||
* Sysmfsg queue | ||
* Sysmfsg queue. | ||
* | ||
* @var resource | ||
*/ | ||
|
@@ -198,7 +198,7 @@ protected function main(): void | |
$this->main(); | ||
}); | ||
|
||
if($event !== null) { | ||
if (null !== $event) { | ||
$this->handleEvent($event); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
@@ -258,12 +258,13 @@ public function cancelJob(ObjectId $id): bool | |
} | ||
|
||
/** | ||
* Flush | ||
* Flush. | ||
*/ | ||
public function flush(): Scheduler | ||
{ | ||
$this->db->{$this->job_queue}->drop(); | ||
$this->db->{$this->event_queue}->drop(); | ||
|
||
return $this; | ||
} | ||
|
||
|
@@ -448,8 +449,8 @@ protected function prepareInsert(string $class, $data, array &$options = []): ar | |
'class' => $class, | ||
'status' => JobInterface::STATUS_WAITING, | ||
'created' => new UTCDateTime(), | ||
'started' => new UTCDateTime(0), | ||
'ended' => new UTCDateTime(0), | ||
'started' => new UTCDateTime(), | ||
'ended' => new UTCDateTime(), | ||
'worker' => new ObjectId(), | ||
'data' => $data, | ||
]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
@@ -113,7 +113,7 @@ class WorkerManager | |
protected $onhold = []; | ||
|
||
/** | ||
* Worker factory | ||
* Worker factory. | ||
* | ||
* @var WorkerFactoryInterface | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
@@ -21,6 +21,7 @@ | |
use TaskScheduler\JobInterface; | ||
use TaskScheduler\Process; | ||
use TaskScheduler\Scheduler; | ||
use MongoDB\BSON\UTCDateTime; | ||
|
||
class SchedulerTest extends TestCase | ||
{ | ||
|
@@ -89,10 +90,11 @@ public function testFlush() | |
|
||
public function testNewJobTimestamps() | ||
{ | ||
$ts = new UTCDateTime(); | ||
$job = $this->scheduler->addJob('test', ['foo' => 'bar'])->toArray(); | ||
$this->assertTrue((string) $job['created'] > '0'); | ||
$this->assertSame((string) $job['started'], '0'); | ||
$this->assertSame((string) $job['ended'], '0'); | ||
$this->assertTrue($job['created'] >= $ts); | ||
$this->assertTrue($job['started'] >= $ts); | ||
$this->assertTrue($job['ended'] >= $ts); | ||
} | ||
|
||
public function testGetJob() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* TaskScheduler | ||
* | ||
* @author Raffael Sahli <[email protected]> | ||
* @copyright Copryright (c) 2017-2018 gyselroth GmbH (https://gyselroth.com) | ||
* @copyright Copryright (c) 2017-2019 gyselroth GmbH (https://gyselroth.com) | ||
* @license MIT https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
|