mirror of
https://github.com/documize/community.git
synced 2025-07-22 22:59:43 +02:00
Record user event backed-up-database
This commit is contained in:
parent
88b84dc5ed
commit
9667e8c2a0
3 changed files with 671 additions and 666 deletions
|
@ -36,6 +36,7 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/documize/community/core/request"
|
||||
"github.com/documize/community/model/audit"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
|
@ -128,13 +129,15 @@ func (h *Handler) Backup(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
h.Runtime.Log.Info(fmt.Sprintf("Backup completed for %s by %s, size %d", ctx.OrgID, ctx.UserID, x))
|
||||
h.Store.Audit.Record(ctx, audit.EventTypeDatabaseBackup)
|
||||
|
||||
// Delete backup file if not requested to keep it.
|
||||
if !spec.Retain {
|
||||
os.Remove(filename)
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
||||
// Restore receives ZIP file for restore operation.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue