Merge pull request #2805 from witekest/recreate_db

Recreate the database on each run
This commit is contained in:
Stephan Kulow 2022-05-12 09:28:47 +02:00 committed by GitHub
commit 551f2f3e59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -443,6 +443,8 @@ function write($points)
if (!$database) { if (!$database) {
$database = InfluxDB\Client::fromDSN('influxdb://0.0.0.0:8086/osrt_access'); $database = InfluxDB\Client::fromDSN('influxdb://0.0.0.0:8086/osrt_access');
$database->drop();
$database->create();
} }
if (!$database->writePoints($points, Database::PRECISION_SECONDS)) die('failed to write points'); if (!$database->writePoints($points, Database::PRECISION_SECONDS)) die('failed to write points');