Skip to content

Commit

Permalink
Make linter happier
Browse files Browse the repository at this point in the history
  • Loading branch information
corny committed Mar 28, 2022
1 parent 7d48594 commit 7d61a28
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
5 changes: 4 additions & 1 deletion database/influxdb/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package influxdb

import (
"fmt"
"log"
"strconv"
"time"

Expand All @@ -15,7 +16,9 @@ import (
func (conn *Connection) PruneNodes(deleteAfter time.Duration) {
for _, measurement := range []string{MeasurementNode, MeasurementLink} {
query := fmt.Sprintf("delete from %s where time < now() - %ds", measurement, deleteAfter/time.Second)
conn.client.Query(client.NewQuery(query, conn.config.Database(), "m"))
if _, err := conn.client.Query(client.NewQuery(query, conn.config.Database(), "m")); err != nil {
log.Println(err)
}
}

}
Expand Down
7 changes: 1 addition & 6 deletions output/geojson/geojson_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ import (
"github.com/FreifunkBremen/yanic/runtime"
)

const (
testNodeDescription string = "Online\nClients: 42\nModel: TP-Link 841\n" +
"Site: mysite\nDomain: domain_42\n"
)

func TestTransform(t *testing.T) {
testNodes := createTestNodes()
nodes := transform(testNodes)
Expand Down Expand Up @@ -41,7 +36,7 @@ func TestTransform(t *testing.T) {
nodePoint.Properties["clients"],
)
assert.Equal(
testNodeDescription,
"Online\nClients: 42\nModel: TP-Link 841\nSite: mysite\nDomain: domain_42\n",
nodePoint.Properties["description"],
)
}
Expand Down
5 changes: 0 additions & 5 deletions output/raw-jsonl/raw_jsonl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ import (
"github.com/FreifunkBremen/yanic/runtime"
)

const (
testNodeDescription string = "Online\nClients: 42\nModel: TP-Link 841\n" +
"Site: mysite\nDomain: domain_42\n"
)

func TestTransform(t *testing.T) {
testNodes := createTestNodes()
result := transform(testNodes)
Expand Down
2 changes: 1 addition & 1 deletion runtime/nodes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func TestSelectNodes(t *testing.T) {
})
assert.Len(selectedNodes, 1)
time := jsontime.Time{}
time.UnmarshalJSON([]byte("2017-03-10T12:12:01"))
assert.NoError(time.UnmarshalJSON([]byte("\"2017-03-10T12:12:01\"")))
assert.Equal(time, selectedNodes[0].Firstseen)
}

Expand Down

0 comments on commit 7d61a28

Please sign in to comment.