diff options
author | Steve Manuel <nilslice@gmail.com> | 2017-06-26 16:56:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-26 16:56:39 -0700 |
commit | e2aeabb21ffae9446d13e43a2feed0002241bb1d (patch) | |
tree | f434af0cca05efedb7aeb8c9c874d58ef39eb859 /system/admin/handlers.go | |
parent | 9105d78ee74858d561f7a60e36f28ed994529452 (diff) | |
parent | 629725aa84c8c0cf66eb1683107aabd6e20928eb (diff) |
Merge pull request #172 from ponzu-cms/ponzu-dev
[core] Add search index backup routine
Diffstat (limited to 'system/admin/handlers.go')
-rw-r--r-- | system/admin/handlers.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go index 0700003..c70dd86 100644 --- a/system/admin/handlers.go +++ b/system/admin/handlers.go @@ -23,6 +23,7 @@ import ( "github.com/ponzu-cms/ponzu/system/api/analytics" "github.com/ponzu-cms/ponzu/system/db" "github.com/ponzu-cms/ponzu/system/item" + "github.com/ponzu-cms/ponzu/system/search" "github.com/gorilla/schema" emailer "github.com/nilslice/email" @@ -224,6 +225,14 @@ func backupHandler(res http.ResponseWriter, req *http.Request) { return } + case "search": + err := search.Backup(ctx, res) + if err != nil { + log.Println("Failed to run backup on search:", err) + res.WriteHeader(http.StatusInternalServerError) + return + } + default: res.WriteHeader(http.StatusBadRequest) } |