mirror of
https://github.com/documize/community.git
synced 2025-07-19 05:09:42 +02:00
Improved backup/restore compatibility between DB providers
This commit is contained in:
parent
3621e2fb79
commit
d04becc1a3
5 changed files with 13 additions and 5 deletions
|
@ -1531,6 +1531,7 @@ func (r *restoreHandler) dmzDocAttachment() (err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.Context.Transaction.Rollback()
|
r.Context.Transaction.Rollback()
|
||||||
err = errors.Wrap(err, fmt.Sprintf("unable to insert %s %s", filename, at[i].RefID))
|
err = errors.Wrap(err, fmt.Sprintf("unable to insert %s %s", filename, at[i].RefID))
|
||||||
|
r.Runtime.Log.Error("warning", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ func (h *Handler) Reindex(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h.Runtime.Log.Info("Building search index")
|
||||||
go h.Indexer.Rebuild(ctx)
|
go h.Indexer.Rebuild(ctx)
|
||||||
|
|
||||||
response.WriteEmpty(w)
|
response.WriteEmpty(w)
|
||||||
|
|
|
@ -129,7 +129,7 @@ func (m *Indexer) Rebuild(ctx domain.RequestContext) {
|
||||||
return
|
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 {
|
for i := range docs {
|
||||||
d := docs[i]
|
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
|
// FilterCategoryProtected removes search results that cannot be seen by user
|
||||||
|
|
|
@ -30,13 +30,13 @@ import (
|
||||||
label "github.com/documize/community/domain/label"
|
label "github.com/documize/community/domain/label"
|
||||||
link "github.com/documize/community/domain/link"
|
link "github.com/documize/community/domain/link"
|
||||||
meta "github.com/documize/community/domain/meta"
|
meta "github.com/documize/community/domain/meta"
|
||||||
|
"github.com/documize/community/domain/onboard"
|
||||||
org "github.com/documize/community/domain/organization"
|
org "github.com/documize/community/domain/organization"
|
||||||
page "github.com/documize/community/domain/page"
|
page "github.com/documize/community/domain/page"
|
||||||
permission "github.com/documize/community/domain/permission"
|
permission "github.com/documize/community/domain/permission"
|
||||||
pin "github.com/documize/community/domain/pin"
|
pin "github.com/documize/community/domain/pin"
|
||||||
search "github.com/documize/community/domain/search"
|
search "github.com/documize/community/domain/search"
|
||||||
setting "github.com/documize/community/domain/setting"
|
setting "github.com/documize/community/domain/setting"
|
||||||
"github.com/documize/community/domain/onboard"
|
|
||||||
space "github.com/documize/community/domain/space"
|
space "github.com/documize/community/domain/space"
|
||||||
"github.com/documize/community/domain/store"
|
"github.com/documize/community/domain/store"
|
||||||
user "github.com/documize/community/domain/user"
|
user "github.com/documize/community/domain/user"
|
||||||
|
@ -192,8 +192,14 @@ func (p MySQLProvider) Params() map[string]string {
|
||||||
return map[string]string{
|
return map[string]string{
|
||||||
"charset": "utf8mb4",
|
"charset": "utf8mb4",
|
||||||
"parseTime": "True",
|
"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
|
// Example holds storage provider specific connection string format
|
||||||
|
|
|
@ -61,7 +61,7 @@ func RegisterEndpoints(rt *env.Runtime, s *store.Store) {
|
||||||
block := block.Handler{Runtime: rt, Store: s}
|
block := block.Handler{Runtime: rt, Store: s}
|
||||||
group := group.Handler{Runtime: rt, Store: s}
|
group := group.Handler{Runtime: rt, Store: s}
|
||||||
label := label.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}
|
section := section.Handler{Runtime: rt, Store: s}
|
||||||
setting := setting.Handler{Runtime: rt, Store: s}
|
setting := setting.Handler{Runtime: rt, Store: s}
|
||||||
category := category.Handler{Runtime: rt, Store: s}
|
category := category.Handler{Runtime: rt, Store: s}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue