mirror of
https://github.com/documize/community.git
synced 2025-08-02 20:15:26 +02:00
[WIP] Backup process outline
This commit is contained in:
parent
8bbb0d3e82
commit
4094677792
18 changed files with 678 additions and 220 deletions
|
@ -161,9 +161,6 @@ func (h *Handler) convert(w http.ResponseWriter, r *http.Request, job, folderID
|
|||
return
|
||||
}
|
||||
|
||||
a, _ := h.Store.Attachment.GetAttachments(ctx, nd.RefID)
|
||||
go h.Indexer.IndexDocument(ctx, nd, a)
|
||||
|
||||
response.WriteJSON(w, nd)
|
||||
}
|
||||
|
||||
|
@ -252,7 +249,6 @@ func processDocument(ctx domain.RequestContext, r *env.Runtime, store *store.Sto
|
|||
ActivityType: activity.TypeCreated})
|
||||
|
||||
err = ctx.Transaction.Commit()
|
||||
|
||||
if err != nil {
|
||||
err = errors.Wrap(err, "cannot commit new document import")
|
||||
return
|
||||
|
@ -260,12 +256,11 @@ func processDocument(ctx domain.RequestContext, r *env.Runtime, store *store.Sto
|
|||
|
||||
newDocument, err = store.Document.Get(ctx, documentID)
|
||||
if err != nil {
|
||||
ctx.Transaction.Rollback()
|
||||
err = errors.Wrap(err, "cannot fetch new document")
|
||||
return
|
||||
}
|
||||
|
||||
indexer.IndexDocument(ctx, newDocument, da)
|
||||
go indexer.IndexDocument(ctx, newDocument, da)
|
||||
|
||||
store.Audit.Record(ctx, audit.EventTypeDocumentUpload)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue