summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2017-01-10 14:07:34 -0800
committerSteve Manuel <nilslice@gmail.com>2017-01-10 14:07:34 -0800
commitbc35db8c462646b8e0ed3bbc94ceca51808a7787 (patch)
tree4998f26c3337372cff501f4bdfee8780bdb51c02
parentf2908a6b3a602394385c7b5bf5014085361549da (diff)
adding pointer fix for decoding, removing print debugs
-rw-r--r--cmd/ponzu/main.go4
-rw-r--r--system/addon/manager.go2
-rw-r--r--system/admin/handlers.go2
-rw-r--r--system/db/init.go8
4 files changed, 3 insertions, 13 deletions
diff --git a/cmd/ponzu/main.go b/cmd/ponzu/main.go
index ae2e4ec..6ac6dad 100644
--- a/cmd/ponzu/main.go
+++ b/cmd/ponzu/main.go
@@ -154,11 +154,9 @@ func main() {
case "serve", "s":
db.Init()
defer db.Close()
- fmt.Println("Ran db.Init")
analytics.Init()
defer analytics.Close()
- fmt.Println("Ran analytics.Init")
if len(args) > 1 {
services := strings.Split(args[1], ",")
@@ -166,10 +164,8 @@ func main() {
for i := range services {
if services[i] == "api" {
api.Run()
- fmt.Println("api.Run()")
} else if services[i] == "admin" {
admin.Run()
- fmt.Println("admin.Run()")
} else {
fmt.Println("To execute 'ponzu serve', you must specify which service to run.")
fmt.Println("$ ponzu --help")
diff --git a/system/addon/manager.go b/system/addon/manager.go
index 3ba67a5..3757421 100644
--- a/system/addon/manager.go
+++ b/system/addon/manager.go
@@ -41,7 +41,7 @@ func Manage(data url.Values, reverseDNS string) ([]byte, error) {
dec := schema.NewDecoder()
dec.IgnoreUnknownKeys(true)
dec.SetAliasTag("json")
- err := dec.Decode(&at, data)
+ err := dec.Decode(at, data)
if err != nil {
return nil, err
}
diff --git a/system/admin/handlers.go b/system/admin/handlers.go
index dc779f3..a8ca681 100644
--- a/system/admin/handlers.go
+++ b/system/admin/handlers.go
@@ -2111,6 +2111,8 @@ func addonsHandler(res http.ResponseWriter, req *http.Request) {
return
}
+ http.Redirect(res, req, req.URL.String(), http.StatusFound)
+
default:
res.WriteHeader(http.StatusBadRequest)
errView, err := Error400()
diff --git a/system/db/init.go b/system/db/init.go
index ff2926c..eaf6d76 100644
--- a/system/db/init.go
+++ b/system/db/init.go
@@ -2,7 +2,6 @@ package db
import (
"encoding/json"
- "fmt"
"log"
"github.com/ponzu-cms/ponzu/system/admin/config"
@@ -25,9 +24,7 @@ func Close() {
// Init creates a db connection, initializes db with required info, sets secrets
func Init() {
- fmt.Println("db.Init inside db package")
if store != nil {
- fmt.Println("db.Init already intialized store")
return
}
@@ -86,21 +83,16 @@ func Init() {
log.Fatalln("Coudn't initialize db with buckets.", err)
}
- fmt.Println("db initialization completed")
-
// invalidate cache on system start
err = InvalidateCache()
if err != nil {
log.Fatalln("Failed to invalidate cache.", err)
}
- fmt.Println("Cache invalidated")
go func() {
for t := range item.Types {
SortContent(t)
}
-
- fmt.Println("content sorted (from goroutine)")
}()
}