mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 22:43:19 +00:00
Default period is 10 seconds
This commit is contained in:
@@ -220,6 +220,7 @@ abstract class task_abstract
|
|||||||
{
|
{
|
||||||
return $this->crash_counter;
|
return $this->crash_counter;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function increment_crash_counter()
|
public function increment_crash_counter()
|
||||||
{
|
{
|
||||||
$conn = connection::getPDOConnection();
|
$conn = connection::getPDOConnection();
|
||||||
@@ -247,7 +248,7 @@ abstract class task_abstract
|
|||||||
return $this->completed_percentage;
|
return $this->completed_percentage;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected $period = 60;
|
protected $period = 10;
|
||||||
protected $taskid = NULL;
|
protected $taskid = NULL;
|
||||||
protected $system = ''; // "DARWIN", "WINDOWS" , "LINUX"...
|
protected $system = ''; // "DARWIN", "WINDOWS" , "LINUX"...
|
||||||
protected $argt = array(
|
protected $argt = array(
|
||||||
@@ -556,9 +557,7 @@ abstract class task_abstract
|
|||||||
|
|
||||||
protected function load_settings(SimpleXMLElement $sx_task_settings)
|
protected function load_settings(SimpleXMLElement $sx_task_settings)
|
||||||
{
|
{
|
||||||
$this->period = (int) $sx_task_settings->period;
|
$this->period = max(10, min(3600, (int) $sx_task_settings->period));
|
||||||
if ($this->period <= 0 || $this->period >= 60 * 60)
|
|
||||||
$this->period = 60;
|
|
||||||
|
|
||||||
$this->maxrecs = (int) $sx_task_settings->maxrecs;
|
$this->maxrecs = (int) $sx_task_settings->maxrecs;
|
||||||
if ($sx_task_settings->maxrecs < 10 || $sx_task_settings->maxrecs > 1000)
|
if ($sx_task_settings->maxrecs < 10 || $sx_task_settings->maxrecs > 1000)
|
||||||
@@ -702,7 +701,7 @@ abstract class task_abstract
|
|||||||
}
|
}
|
||||||
catch (Exception $e)
|
catch (Exception $e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
Reference in New Issue
Block a user