diff options
author | Steve Manuel <nilslice@gmail.com> | 2020-01-01 17:14:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-01 17:14:32 -0700 |
commit | 9bc41b703131aa42ca64265ab6fdeadc37841e66 (patch) | |
tree | 138e6b7d6f8bd5c879eff61ce85df95506546003 /system/api | |
parent | 45730ba5b4de56fed27f79f8c822bb59d41f7a38 (diff) | |
parent | 6ee81caea4649d3fc3bb6b5bde0628cb91c8e6f5 (diff) |
Merge pull request #333 from mangelajo/env-vars-for-dirs
Allow data directories outside pwd
Diffstat (limited to 'system/api')
-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) } |