fixed bug to create database.
This commit is contained in:
parent
a6aa660444
commit
27b6c41846
@ -50,7 +50,7 @@ class Temperature
|
||||
{
|
||||
$fpath = $this->getFilePath($id);
|
||||
if (!file_exists($fpath)) {
|
||||
if (!$this->_createDatabase($fpath)) {
|
||||
if (!$this->create($id)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -106,12 +106,12 @@ class Temperature
|
||||
*
|
||||
* @return bool false if failure
|
||||
*/
|
||||
private function create(string $id): boolean
|
||||
private function create(string $id): bool
|
||||
{
|
||||
$fpath = $this->getFilePath($id);
|
||||
$options = [
|
||||
'--step', '60', // 1min step
|
||||
sprintf('DS:%s:GAUGE:600:0:100', $this->id), // 10min hartbeat
|
||||
sprintf('DS:%s:GAUGE:600:0:100', $id), // 10min hartbeat
|
||||
'RRA:LAST:0.5:1:1440', // last/m - 1day(1440min)
|
||||
'RRA:LAST:0.5:30:52560', // last/30m - 3years(365day=30min*17520)*3
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user