mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-12 06:48:41 +00:00
Improve taskschedule tests and implementation
This commit is contained in:
parent
3251816b80
commit
0d7d252b56
|
|
@ -93,4 +93,11 @@ class ConsoleSession implements SessionInterface
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function lock()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -93,4 +93,11 @@ class SocketSession implements SessionInterface
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function lock()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ namespace phpOMS\Utils\TaskSchedule;
|
||||||
* @license OMS License 1.0
|
* @license OMS License 1.0
|
||||||
* @link http://website.orange-management.de
|
* @link http://website.orange-management.de
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
class Cron extends SchedulerAbstract
|
class Cron extends SchedulerAbstract
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ abstract class SchedulerAbstract
|
||||||
* @return bool
|
* @return bool
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
public static function test() : bool
|
public static function test() : bool
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -85,9 +85,20 @@ abstract class TaskAbstract
|
||||||
*/
|
*/
|
||||||
protected $comment = '';
|
protected $comment = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param string $name Id/name of the task (on linux the same as the executable script)
|
||||||
|
* @param string $cmd Command to create the task
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public function __construct(string $name, string $cmd = '') {
|
public function __construct(string $name, string $cmd = '') {
|
||||||
$this->id = $name;
|
$this->id = $name;
|
||||||
$this->command = $cmd;
|
$this->command = $cmd;
|
||||||
|
|
||||||
|
$this->lastRunTime = new \DateTime('1900-01-01');
|
||||||
|
$this->nextRunTime = new \DateTime('1900-01-01');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -258,18 +269,6 @@ abstract class TaskAbstract
|
||||||
$this->comment = $comment;
|
$this->comment = $comment;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get comment.
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function addResult(string $result)
|
|
||||||
{
|
|
||||||
$this->results[] = $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create task based on job data
|
* Create task based on job data
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ use phpOMS\Validation\Base\DateTime;
|
||||||
* @license OMS License 1.0
|
* @license OMS License 1.0
|
||||||
* @link http://website.orange-management.de
|
* @link http://website.orange-management.de
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
class TaskScheduler extends SchedulerAbstract
|
class TaskScheduler extends SchedulerAbstract
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user