diff options
author | Miguel Angel Ajo <majopela@redhat.com> | 2019-12-30 00:02:14 +0100 |
---|---|---|
committer | Miguel Angel Ajo <majopela@redhat.com> | 2019-12-30 00:02:14 +0100 |
commit | 10d7c93dd0103a46b22100c9b681e270bfd3c3a0 (patch) | |
tree | 13f390748c191be0e3b2b676a53a7d5b800f7d98 /system/api/analytics/init.go | |
parent | 90a2ff959a958e8f7654f577e88e942378b0a7c2 (diff) |
Also add path to db files
Diffstat (limited to 'system/api/analytics/init.go')
-rw-r--r-- | system/api/analytics/init.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/system/api/analytics/init.go b/system/api/analytics/init.go index caa187a..0e9e90e 100644 --- a/system/api/analytics/init.go +++ b/system/api/analytics/init.go @@ -7,11 +7,13 @@ import ( "encoding/json" "log" "net/http" + "path/filepath" "runtime" "strings" "time" "github.com/boltdb/bolt" + "github.com/ponzu-cms/ponzu/system/cfg" ) type apiRequest struct { @@ -72,7 +74,8 @@ func Close() { // sets up the queue/batching channel func Init() { var err error - store, err = bolt.Open("analytics.db", 0666, nil) + analyticsDb := filepath.Join(cfg.DataDir(),"analytics.db") + store, err = bolt.Open(analyticsDb, 0666, nil) if err != nil { log.Fatalln(err) } |