Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ee97416dd | ||
|
|
ecb1f3b2cf |
@@ -7,6 +7,7 @@ import (
|
|||||||
"github.com/tecamino/tecamino-dbm/models"
|
"github.com/tecamino/tecamino-dbm/models"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// DBM cli arguments
|
||||||
type Args struct {
|
type Args struct {
|
||||||
Port models.Port
|
Port models.Port
|
||||||
Cert cert.Cert
|
Cert cert.Cert
|
||||||
@@ -15,6 +16,7 @@ type Args struct {
|
|||||||
Debug bool
|
Debug bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// initialte cli arguments
|
||||||
func Init() *Args {
|
func Init() *Args {
|
||||||
|
|
||||||
a := Args{
|
a := Args{
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -87,6 +88,12 @@ func (d *DBMHandler) SaveDb() (err error) {
|
|||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
for _, dp := range d.DB.GetAllDatapoints(0) {
|
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)
|
b, er := json.Marshal(dp)
|
||||||
if er != nil {
|
if er != nil {
|
||||||
return er
|
return er
|
||||||
|
|||||||
Reference in New Issue
Block a user