summaryrefslogtreecommitdiffstats
path: root/store
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-08-18 12:45:48 -0700
committerCorey Hulen <corey@hulen.com>2017-08-18 12:45:48 -0700
commit2461c55d0d879fb7be79044feb10bc86b301fdb7 (patch)
tree84014112bd3dae0d45e826456b42291fc0e85dfa /store
parent17098fb2a34c3e5ee12bdd64c0f8954532554831 (diff)
downloadchat-2461c55d0d879fb7be79044feb10bc86b301fdb7.tar.gz
chat-2461c55d0d879fb7be79044feb10bc86b301fdb7.tar.bz2
chat-2461c55d0d879fb7be79044feb10bc86b301fdb7.zip
Ignoring primary key duplication errors on status saveorupdate (#7255)
Diffstat (limited to 'store')
-rw-r--r--store/sql_status_store.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/store/sql_status_store.go b/store/sql_status_store.go
index 005b858c6..ce8cc1cfd 100644
--- a/store/sql_status_store.go
+++ b/store/sql_status_store.go
@@ -6,6 +6,7 @@ package store
import (
"database/sql"
"strconv"
+ "strings"
"github.com/mattermost/platform/model"
)
@@ -48,7 +49,9 @@ func (s SqlStatusStore) SaveOrUpdate(status *model.Status) StoreChannel {
}
} else {
if err := s.GetMaster().Insert(status); err != nil {
- result.Err = model.NewLocAppError("SqlStatusStore.SaveOrUpdate", "store.sql_status.save.app_error", nil, err.Error())
+ if !(strings.Contains(err.Error(), "for key 'PRIMARY'") && strings.Contains(err.Error(), "Duplicate entry")) {
+ result.Err = model.NewLocAppError("SqlStatusStore.SaveOrUpdate", "store.sql_status.save.app_error", nil, err.Error())
+ }
}
}