Skip to content

Commit

Permalink
Merge pull request #15 from CameronRP/update-go
Browse files Browse the repository at this point in the history
Update API and upload previous devices events first
  • Loading branch information
CameronRP authored Nov 22, 2021
2 parents db2dfbd + b231859 commit 597386d
Show file tree
Hide file tree
Showing 3 changed files with 663 additions and 30 deletions.
10 changes: 10 additions & 0 deletions cmd/device-register/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"strings"
"time"

"github.com/TheCacophonyProject/event-reporter/v3/eventclient"
"github.com/TheCacophonyProject/go-api"
"github.com/TheCacophonyProject/go-config"
"github.com/TheCacophonyProject/modemd/connrequester"
Expand Down Expand Up @@ -184,6 +185,10 @@ func writeToMinionIDFile(name string) error {
}

func deleteDeviceConfigFiles() error {
// Want to upload previous devices events first
if err := eventclient.UploadEvents(); err != nil {
return err
}
conf, err := config.New(config.DefaultConfigDir)
if err != nil {
return err
Expand Down Expand Up @@ -219,6 +224,11 @@ func checkMinionIDFile() (int, error) {
}

func reregister(args Args) error {
// Want to upload previous devices events first
if err := eventclient.UploadEvents(); err != nil {
return err
}

apiClient, err := api.New()
if err != nil {
return err
Expand Down
9 changes: 6 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ module github.com/TheCacophonyProject/device-register
go 1.12

require (
github.com/TheCacophonyProject/go-api v1.0.0
github.com/TheCacophonyProject/go-config v1.4.0
github.com/TheCacophonyProject/event-reporter/v3 v3.3.0
github.com/TheCacophonyProject/go-api v1.0.1
github.com/TheCacophonyProject/go-config v1.7.0
github.com/TheCacophonyProject/modemd v0.0.0-20190708011609-1940f5b6677b
github.com/alexflint/go-arg v1.1.0
github.com/alexflint/go-arg v1.4.2
github.com/dustinkirkland/golang-petname v0.0.0-20190613200456-11339a705ed2
)

replace periph.io/x/periph => github.com/TheCacophonyProject/periph v2.1.1-0.20200615222341-6834cd5be8c1+incompatible
Loading

0 comments on commit 597386d

Please sign in to comment.