Initial migration of the store to be sync (#10592)

* Migrating audit store

* Final migration example for the audit store

* async example

* Ending migration

* Removing Async helper

* Fixing tests

* Fixing govet problems with the StoreResult instanstiation
Этот коммит содержится в:
Jesús Espino
2019-04-15 22:53:52 +02:00
коммит произвёл GitHub
родитель 957ec1388b
Коммит 12c50eb830
30 изменённых файлов: 597 добавлений и 583 удалений

Просмотреть файл

@@ -25,8 +25,8 @@ type Context struct {
func (c *Context) LogAudit(extraInfo string) {
audit := &model.Audit{UserId: c.App.Session.UserId, IpAddress: c.App.IpAddress, Action: c.App.Path, ExtraInfo: extraInfo, SessionId: c.App.Session.Id}
if r := <-c.App.Srv.Store.Audit().Save(audit); r.Err != nil {
c.LogError(r.Err)
if err := c.App.Srv.Store.Audit().Save(audit); err != nil {
c.LogError(err)
}
}
@@ -37,8 +37,8 @@ func (c *Context) LogAuditWithUserId(userId, extraInfo string) {
}
audit := &model.Audit{UserId: userId, IpAddress: c.App.IpAddress, Action: c.App.Path, ExtraInfo: extraInfo, SessionId: c.App.Session.Id}
if r := <-c.App.Srv.Store.Audit().Save(audit); r.Err != nil {
c.LogError(r.Err)
if err := c.App.Srv.Store.Audit().Save(audit); err != nil {
c.LogError(err)
}
}