mirror of
https://github.com/documize/community.git
synced 2025-08-05 05:25:27 +02:00
Overhaul the space stats module
Closes #274 All space counters are reset after document and catergory operations.
This commit is contained in:
parent
6b723568d3
commit
fad1de2e41
7 changed files with 1095 additions and 1142 deletions
|
@ -249,12 +249,6 @@ func processDocument(ctx domain.RequestContext, r *env.Runtime, store *store.Sto
|
|||
SourceType: activity.SourceTypeDocument,
|
||||
ActivityType: activity.TypeCreated})
|
||||
|
||||
err = store.Space.IncrementContentCount(ctx, newDocument.SpaceID)
|
||||
if err != nil {
|
||||
err = errors.Wrap(err, "cannot increment space content count")
|
||||
return
|
||||
}
|
||||
|
||||
err = ctx.Transaction.Commit()
|
||||
if err != nil {
|
||||
err = errors.Wrap(err, "cannot commit new document import")
|
||||
|
@ -269,6 +263,7 @@ func processDocument(ctx domain.RequestContext, r *env.Runtime, store *store.Sto
|
|||
|
||||
go indexer.IndexDocument(ctx, newDocument, da)
|
||||
|
||||
store.Space.SetStats(ctx, newDocument.SpaceID)
|
||||
store.Audit.Record(ctx, audit.EventTypeDocumentUpload)
|
||||
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue