mirror of
https://github.com/documize/community.git
synced 2025-08-06 22:15:25 +02:00
Introduce transaction isolation customization
Search related indexing transactions requires better TX begin/commit. New helpers provide TX isolation control.
This commit is contained in:
parent
36d7136210
commit
f062005946
5 changed files with 63 additions and 65 deletions
|
@ -24,7 +24,6 @@ import (
|
|||
"github.com/documize/community/model/doc"
|
||||
"github.com/documize/community/model/page"
|
||||
"github.com/documize/community/model/search"
|
||||
"github.com/documize/community/model/workflow"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
|
@ -125,11 +124,6 @@ func (s Store) DeleteDocument(ctx domain.RequestContext, ID string) (err error)
|
|||
func (s Store) IndexContent(ctx domain.RequestContext, p page.Page) (err error) {
|
||||
method := "search.IndexContent"
|
||||
|
||||
// we do not index pending pages
|
||||
if p.Status == workflow.ChangePending || p.Status == workflow.ChangePendingNew {
|
||||
return
|
||||
}
|
||||
|
||||
// remove previous search entries
|
||||
_, err = ctx.Transaction.Exec(s.Bind("DELETE FROM dmz_search WHERE c_orgid=? AND c_docid=? AND c_itemid=? AND c_itemtype='page'"),
|
||||
ctx.OrgID, p.DocumentID, p.RefID)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue