Fixed ServerScheduler::addTask() period

This commit is contained in:
Shoghi Cervantes 2014-07-03 19:35:59 +02:00
parent 32f67d7187
commit 8b2440ff96

View File

@ -168,10 +168,10 @@ class ServerScheduler{
$delay = -1; $delay = -1;
} }
if($period === 1){ if($period < -1){
$period = 1;
}elseif($period < -1){
$period = -1; $period = -1;
}elseif($period < 1){
$period = 1;
} }
return $this->handle(new TaskHandler($task, $this->nextId(), $delay, $period)); return $this->handle(new TaskHandler($task, $this->nextId(), $delay, $period));
@ -237,4 +237,4 @@ class ServerScheduler{
return $this->ids++; return $this->ids++;
} }
} }