summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-08-21 14:56:57 -0700
committerCorey Hulen <corey@hulen.com>2015-08-21 14:56:57 -0700
commit06c5ddcb1d9e4e2e79b33196a58c5d62c0c43e37 (patch)
tree25a9dcad2d64b51fea65359e5013d0d93bab61bd
parent76813b5a55cb838d3d0676d2ab73ff9987117a05 (diff)
parentf96b38b4a71bef011053668cae9ea74cfaf64315 (diff)
downloadchat-06c5ddcb1d9e4e2e79b33196a58c5d62c0c43e37.tar.gz
chat-06c5ddcb1d9e4e2e79b33196a58c5d62c0c43e37.tar.bz2
chat-06c5ddcb1d9e4e2e79b33196a58c5d62c0c43e37.zip
Merge pull request #443 from mattermost/fixing-build
Fixes race condition
-rw-r--r--store/sql_channel_store.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go
index a7577e645..d503d2225 100644
--- a/store/sql_channel_store.go
+++ b/store/sql_channel_store.go
@@ -4,7 +4,6 @@
package store
import (
- "fmt"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
)
@@ -154,10 +153,17 @@ func (s SqlChannelStore) extraUpdated(channel *model.Channel) StoreChannel {
channel.ExtraUpdated()
- if count, err := s.GetMaster().Update(channel); err != nil {
+ _, err := s.GetMaster().Exec(
+ `UPDATE
+ Channels
+ SET
+ ExtraUpdateAt = :Time
+ WHERE
+ Id = :Id`,
+ map[string]interface{}{"Id": channel.Id, "Time": channel.ExtraUpdateAt})
+
+ if err != nil {
result.Err = model.NewAppError("SqlChannelStore.extraUpdated", "Problem updating members last updated time", "id="+channel.Id+", "+err.Error())
- } else if count != 1 {
- result.Err = model.NewAppError("SqlChannelStore.extraUpdated", "Problem updating members last updated time", fmt.Sprintf("id=%v, count=%v", channel.Id, count))
}
storeChannel <- result