1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-18 20:59:43 +02:00

Improved backup/restore compatibility between DB providers

This commit is contained in:
HarveyKandola 2019-06-25 15:26:38 +01:00
parent 3621e2fb79
commit d04becc1a3
5 changed files with 13 additions and 5 deletions

View file

@ -1531,6 +1531,7 @@ func (r *restoreHandler) dmzDocAttachment() (err error) {
if err != nil {
r.Context.Transaction.Rollback()
err = errors.Wrap(err, fmt.Sprintf("unable to insert %s %s", filename, at[i].RefID))
r.Runtime.Log.Error("warning", err)
return
}
}

View file

@ -38,6 +38,7 @@ func (h *Handler) Reindex(w http.ResponseWriter, r *http.Request) {
return
}
h.Runtime.Log.Info("Building search index")
go h.Indexer.Rebuild(ctx)
response.WriteEmpty(w)

View file

@ -129,7 +129,7 @@ func (m *Indexer) Rebuild(ctx domain.RequestContext) {
return
}
m.runtime.Log.Info(fmt.Sprintf("Search re-index started for %d documents", len(docs)))
m.runtime.Log.Info(fmt.Sprintf("Search re-indexing started for %d documents", len(docs)))
for i := range docs {
d := docs[i]
@ -163,7 +163,7 @@ func (m *Indexer) Rebuild(ctx domain.RequestContext) {
}
}
m.runtime.Log.Info(fmt.Sprintf("Search re-index finished for %d documents", len(docs)))
m.runtime.Log.Info(fmt.Sprintf("Search re-indexing finished for %d documents", len(docs)))
}
// FilterCategoryProtected removes search results that cannot be seen by user

View file

@ -30,13 +30,13 @@ import (
label "github.com/documize/community/domain/label"
link "github.com/documize/community/domain/link"
meta "github.com/documize/community/domain/meta"
"github.com/documize/community/domain/onboard"
org "github.com/documize/community/domain/organization"
page "github.com/documize/community/domain/page"
permission "github.com/documize/community/domain/permission"
pin "github.com/documize/community/domain/pin"
search "github.com/documize/community/domain/search"
setting "github.com/documize/community/domain/setting"
"github.com/documize/community/domain/onboard"
space "github.com/documize/community/domain/space"
"github.com/documize/community/domain/store"
user "github.com/documize/community/domain/user"
@ -192,8 +192,14 @@ func (p MySQLProvider) Params() map[string]string {
return map[string]string{
"charset": "utf8mb4",
"parseTime": "True",
"maxAllowedPacket": "104857600", // 4194304 // 16777216 = 16MB // 104857600 = 100MB
"maxAllowedPacket": "0",
}
// maxAllowedPacket
// default is 4194304
// 16777216 = 16MB
// 104857600 = 100MB
// 0 means fetch value from server
}
// Example holds storage provider specific connection string format

View file

@ -61,7 +61,7 @@ func RegisterEndpoints(rt *env.Runtime, s *store.Store) {
block := block.Handler{Runtime: rt, Store: s}
group := group.Handler{Runtime: rt, Store: s}
label := label.Handler{Runtime: rt, Store: s}
backup := backup.Handler{Runtime: rt, Store: s}
backup := backup.Handler{Runtime: rt, Store: s, Indexer: indexer}
section := section.Handler{Runtime: rt, Store: s}
setting := setting.Handler{Runtime: rt, Store: s}
category := category.Handler{Runtime: rt, Store: s}