2 Commits

Author SHA1 Message Date
Adrian Zürcher
5ee97416dd add comments 2025-05-08 17:28:47 +02:00
Adrian Zürcher
ecb1f3b2cf exclude system datapoints from saving 2025-05-08 17:28:35 +02:00
2 changed files with 9 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ import (
"github.com/tecamino/tecamino-dbm/models"
)
// DBM cli arguments
type Args struct {
Port models.Port
Cert cert.Cert
@@ -15,6 +16,7 @@ type Args struct {
Debug bool
}
// initialte cli arguments
func Init() *Args {
a := Args{

View File

@@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"os"
"strings"
"sync"
"time"
@@ -87,6 +88,12 @@ func (d *DBMHandler) SaveDb() (err error) {
defer f.Close()
for _, dp := range d.DB.GetAllDatapoints(0) {
//exclude System datapoints from saving
//System datapoints are used for internal purposes and should not be saved in the database
if strings.Contains(dp.Path, "System:") {
continue
}
b, er := json.Marshal(dp)
if er != nil {
return er