From 2ca751febff968ddad65a7f55bffde631392c093 Mon Sep 17 00:00:00 2001 From: Kyo Nguyen Date: Mon, 19 Sep 2016 19:30:41 +0700 Subject: Fix leaking goroutines in store calls (#3993). (#4021) --- store/sql_audit_store.go | 6 ++--- store/sql_channel_store.go | 59 +++++++++++++++++++++--------------------- store/sql_command_store.go | 14 +++++----- store/sql_compliance_store.go | 13 +++++----- store/sql_emoji_store.go | 10 ++++---- store/sql_license_store.go | 4 +-- store/sql_oauth_store.go | 39 ++++++++++++++-------------- store/sql_post_store.go | 36 +++++++++++++------------- store/sql_preference_store.go | 14 +++++----- store/sql_recovery_store.go | 8 +++--- store/sql_session_store.go | 22 ++++++++-------- store/sql_status_store.go | 16 ++++++------ store/sql_system_store.go | 10 ++++---- store/sql_team_store.go | 38 +++++++++++++-------------- store/sql_user_store.go | 60 +++++++++++++++++++++---------------------- store/sql_webhook_store.go | 30 +++++++++++----------- 16 files changed, 191 insertions(+), 188 deletions(-) (limited to 'store') diff --git a/store/sql_audit_store.go b/store/sql_audit_store.go index 78e875a74..7e8fa74e4 100644 --- a/store/sql_audit_store.go +++ b/store/sql_audit_store.go @@ -33,7 +33,7 @@ func (s SqlAuditStore) CreateIndexesIfNotExists() { func (s SqlAuditStore) Save(audit *model.Audit) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -56,7 +56,7 @@ func (s SqlAuditStore) Save(audit *model.Audit) StoreChannel { func (s SqlAuditStore) Get(user_id string, limit int) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -93,7 +93,7 @@ func (s SqlAuditStore) Get(user_id string, limit int) StoreChannel { func (s SqlAuditStore) PermanentDeleteByUser(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go index 2400c34f3..c0f9bddf0 100644 --- a/store/sql_channel_store.go +++ b/store/sql_channel_store.go @@ -5,6 +5,7 @@ package store import ( "database/sql" + "github.com/go-gorp/gorp" "github.com/mattermost/platform/model" "github.com/mattermost/platform/utils" @@ -54,7 +55,7 @@ func (s SqlChannelStore) CreateIndexesIfNotExists() { } func (s SqlChannelStore) Save(channel *model.Channel) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { var result StoreResult @@ -83,7 +84,7 @@ func (s SqlChannelStore) Save(channel *model.Channel) StoreChannel { } func (s SqlChannelStore) SaveDirectChannel(directchannel *model.Channel, member1 *model.ChannelMember, member2 *model.ChannelMember) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { var result StoreResult @@ -183,7 +184,7 @@ func (s SqlChannelStore) saveChannelT(transaction *gorp.Transaction, channel *mo func (s SqlChannelStore) Update(channel *model.Channel) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -222,7 +223,7 @@ func (s SqlChannelStore) Update(channel *model.Channel) StoreChannel { } func (s SqlChannelStore) extraUpdated(channel *model.Channel) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -258,7 +259,7 @@ func (s SqlChannelStore) GetFromMaster(id string) StoreChannel { } func (s SqlChannelStore) get(id string, master bool) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -290,7 +291,7 @@ func (s SqlChannelStore) Delete(channelId string, time int64) StoreChannel { } func (s SqlChannelStore) SetDeleteAt(channelId string, deleteAt int64, updateAt int64) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -308,7 +309,7 @@ func (s SqlChannelStore) SetDeleteAt(channelId string, deleteAt int64, updateAt } func (s SqlChannelStore) PermanentDeleteByTeam(teamId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -330,7 +331,7 @@ type channelWithMember struct { } func (s SqlChannelStore) GetChannels(teamId string, userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -363,7 +364,7 @@ func (s SqlChannelStore) GetChannels(teamId string, userId string) StoreChannel } func (s SqlChannelStore) GetMoreChannels(teamId string, userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -411,7 +412,7 @@ type channelIdWithCountAndUpdateAt struct { } func (s SqlChannelStore) GetChannelCounts(teamId string, userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -440,7 +441,7 @@ func (s SqlChannelStore) GetChannelCounts(teamId string, userId string) StoreCha } func (s SqlChannelStore) GetByName(teamId string, name string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -465,7 +466,7 @@ func (s SqlChannelStore) GetByName(teamId string, name string) StoreChannel { } func (s SqlChannelStore) SaveMember(member *model.ChannelMember) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { var result StoreResult @@ -522,7 +523,7 @@ func (s SqlChannelStore) saveMemberT(transaction *gorp.Transaction, member *mode } func (s SqlChannelStore) UpdateMember(member *model.ChannelMember) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -550,7 +551,7 @@ func (s SqlChannelStore) UpdateMember(member *model.ChannelMember) StoreChannel } func (s SqlChannelStore) GetMembers(channelId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -571,7 +572,7 @@ func (s SqlChannelStore) GetMembers(channelId string) StoreChannel { } func (s SqlChannelStore) GetMember(channelId string, userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -596,7 +597,7 @@ func (s SqlChannelStore) GetMember(channelId string, userId string) StoreChannel } func (s SqlChannelStore) GetMemberCount(channelId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -625,7 +626,7 @@ func (s SqlChannelStore) GetMemberCount(channelId string) StoreChannel { } func (s SqlChannelStore) GetExtraMembers(channelId string, limit int) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -683,7 +684,7 @@ func (s SqlChannelStore) GetExtraMembers(channelId string, limit int) StoreChann } func (s SqlChannelStore) RemoveMember(channelId string, userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -713,7 +714,7 @@ func (s SqlChannelStore) RemoveMember(channelId string, userId string) StoreChan } func (s SqlChannelStore) PermanentDeleteMembersByUser(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -730,7 +731,7 @@ func (s SqlChannelStore) PermanentDeleteMembersByUser(userId string) StoreChanne } func (s SqlChannelStore) CheckPermissionsToNoTeam(channelId string, userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -761,7 +762,7 @@ func (s SqlChannelStore) CheckPermissionsToNoTeam(channelId string, userId strin } func (s SqlChannelStore) CheckPermissionsTo(teamId string, channelId string, userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -793,7 +794,7 @@ func (s SqlChannelStore) CheckPermissionsTo(teamId string, channelId string, use } func (s SqlChannelStore) CheckPermissionsToByName(teamId string, channelName string, userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -825,7 +826,7 @@ func (s SqlChannelStore) CheckPermissionsToByName(teamId string, channelName str } func (s SqlChannelStore) CheckOpenChannelPermissions(teamId string, channelId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -854,7 +855,7 @@ func (s SqlChannelStore) CheckOpenChannelPermissions(teamId string, channelId st } func (s SqlChannelStore) SetLastViewedAt(channelId string, userId string, newLastViewedAt int64) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -906,7 +907,7 @@ func (s SqlChannelStore) SetLastViewedAt(channelId string, userId string, newLas } func (s SqlChannelStore) UpdateLastViewedAt(channelId string, userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -954,7 +955,7 @@ func (s SqlChannelStore) UpdateLastViewedAt(channelId string, userId string) Sto } func (s SqlChannelStore) IncrementMentionCount(channelId string, userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -980,7 +981,7 @@ func (s SqlChannelStore) IncrementMentionCount(channelId string, userId string) } func (s SqlChannelStore) GetAll(teamId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -1002,7 +1003,7 @@ func (s SqlChannelStore) GetAll(teamId string) StoreChannel { } func (s SqlChannelStore) AnalyticsTypeCount(teamId string, channelType string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -1028,7 +1029,7 @@ func (s SqlChannelStore) AnalyticsTypeCount(teamId string, channelType string) S } func (s SqlChannelStore) ExtraUpdateByUser(userId string, time int64) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} diff --git a/store/sql_command_store.go b/store/sql_command_store.go index 4332f1e93..410f9a287 100644 --- a/store/sql_command_store.go +++ b/store/sql_command_store.go @@ -39,7 +39,7 @@ func (s SqlCommandStore) CreateIndexesIfNotExists() { } func (s SqlCommandStore) Save(command *model.Command) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -72,7 +72,7 @@ func (s SqlCommandStore) Save(command *model.Command) StoreChannel { } func (s SqlCommandStore) Get(id string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -93,7 +93,7 @@ func (s SqlCommandStore) Get(id string) StoreChannel { } func (s SqlCommandStore) GetByTeam(teamId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -114,7 +114,7 @@ func (s SqlCommandStore) GetByTeam(teamId string) StoreChannel { } func (s SqlCommandStore) Delete(commandId string, time int64) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -132,7 +132,7 @@ func (s SqlCommandStore) Delete(commandId string, time int64) StoreChannel { } func (s SqlCommandStore) PermanentDeleteByUser(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -150,7 +150,7 @@ func (s SqlCommandStore) PermanentDeleteByUser(userId string) StoreChannel { } func (s SqlCommandStore) Update(cmd *model.Command) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -171,7 +171,7 @@ func (s SqlCommandStore) Update(cmd *model.Command) StoreChannel { } func (s SqlCommandStore) AnalyticsCommandCount(teamId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} diff --git a/store/sql_compliance_store.go b/store/sql_compliance_store.go index 248d5c47b..6aaef856d 100644 --- a/store/sql_compliance_store.go +++ b/store/sql_compliance_store.go @@ -4,9 +4,10 @@ package store import ( - "github.com/mattermost/platform/model" "strconv" "strings" + + "github.com/mattermost/platform/model" ) type SqlComplianceStore struct { @@ -35,7 +36,7 @@ func (s SqlComplianceStore) CreateIndexesIfNotExists() { func (s SqlComplianceStore) Save(compliance *model.Compliance) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -62,7 +63,7 @@ func (s SqlComplianceStore) Save(compliance *model.Compliance) StoreChannel { func (us SqlComplianceStore) Update(compliance *model.Compliance) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -88,7 +89,7 @@ func (us SqlComplianceStore) Update(compliance *model.Compliance) StoreChannel { func (s SqlComplianceStore) GetAll() StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -111,7 +112,7 @@ func (s SqlComplianceStore) GetAll() StoreChannel { func (us SqlComplianceStore) Get(id string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -133,7 +134,7 @@ func (us SqlComplianceStore) Get(id string) StoreChannel { } func (s SqlComplianceStore) ComplianceExport(job *model.Compliance) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} diff --git a/store/sql_emoji_store.go b/store/sql_emoji_store.go index 45af85931..85fd1a80d 100644 --- a/store/sql_emoji_store.go +++ b/store/sql_emoji_store.go @@ -30,7 +30,7 @@ func (es SqlEmojiStore) CreateIndexesIfNotExists() { } func (es SqlEmojiStore) Save(emoji *model.Emoji) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -56,7 +56,7 @@ func (es SqlEmojiStore) Save(emoji *model.Emoji) StoreChannel { } func (es SqlEmojiStore) Get(id string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -84,7 +84,7 @@ func (es SqlEmojiStore) Get(id string) StoreChannel { } func (es SqlEmojiStore) GetByName(name string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -112,7 +112,7 @@ func (es SqlEmojiStore) GetByName(name string) StoreChannel { } func (es SqlEmojiStore) GetAll() StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -139,7 +139,7 @@ func (es SqlEmojiStore) GetAll() StoreChannel { } func (es SqlEmojiStore) Delete(id string, time int64) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} diff --git a/store/sql_license_store.go b/store/sql_license_store.go index 73faad8b9..6e4cb98c8 100644 --- a/store/sql_license_store.go +++ b/store/sql_license_store.go @@ -28,7 +28,7 @@ func (ls SqlLicenseStore) CreateIndexesIfNotExists() { func (ls SqlLicenseStore) Save(license *model.LicenseRecord) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -58,7 +58,7 @@ func (ls SqlLicenseStore) Save(license *model.LicenseRecord) StoreChannel { func (ls SqlLicenseStore) Get(id string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} diff --git a/store/sql_oauth_store.go b/store/sql_oauth_store.go index c162f36b4..caa04c008 100644 --- a/store/sql_oauth_store.go +++ b/store/sql_oauth_store.go @@ -4,9 +4,10 @@ package store import ( + "strings" + "github.com/go-gorp/gorp" "github.com/mattermost/platform/model" - "strings" ) type SqlOAuthStore struct { @@ -57,7 +58,7 @@ func (as SqlOAuthStore) CreateIndexesIfNotExists() { func (as SqlOAuthStore) SaveApp(app *model.OAuthApp) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -91,7 +92,7 @@ func (as SqlOAuthStore) SaveApp(app *model.OAuthApp) StoreChannel { func (as SqlOAuthStore) UpdateApp(app *model.OAuthApp) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -131,7 +132,7 @@ func (as SqlOAuthStore) UpdateApp(app *model.OAuthApp) StoreChannel { func (as SqlOAuthStore) GetApp(id string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -154,7 +155,7 @@ func (as SqlOAuthStore) GetApp(id string) StoreChannel { func (as SqlOAuthStore) GetAppByUser(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -176,7 +177,7 @@ func (as SqlOAuthStore) GetAppByUser(userId string) StoreChannel { func (as SqlOAuthStore) GetApps() StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -197,7 +198,7 @@ func (as SqlOAuthStore) GetApps() StoreChannel { } func (as SqlOAuthStore) GetAuthorizedApps(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -220,7 +221,7 @@ func (as SqlOAuthStore) GetAuthorizedApps(userId string) StoreChannel { } func (as SqlOAuthStore) DeleteApp(id string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -255,7 +256,7 @@ func (as SqlOAuthStore) DeleteApp(id string) StoreChannel { func (as SqlOAuthStore) SaveAccessData(accessData *model.AccessData) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -281,7 +282,7 @@ func (as SqlOAuthStore) SaveAccessData(accessData *model.AccessData) StoreChanne func (as SqlOAuthStore) GetAccessData(token string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -304,7 +305,7 @@ func (as SqlOAuthStore) GetAccessData(token string) StoreChannel { func (as SqlOAuthStore) GetAccessDataByUserForApp(userId, clientId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -331,7 +332,7 @@ func (as SqlOAuthStore) GetAccessDataByUserForApp(userId, clientId string) Store func (as SqlOAuthStore) GetAccessDataByRefreshToken(token string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -354,7 +355,7 @@ func (as SqlOAuthStore) GetAccessDataByRefreshToken(token string) StoreChannel { func (as SqlOAuthStore) GetPreviousAccessData(userId, clientId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -381,7 +382,7 @@ func (as SqlOAuthStore) GetPreviousAccessData(userId, clientId string) StoreChan } func (as SqlOAuthStore) UpdateAccessData(accessData *model.AccessData) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -402,7 +403,7 @@ func (as SqlOAuthStore) UpdateAccessData(accessData *model.AccessData) StoreChan } func (as SqlOAuthStore) RemoveAccessData(token string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -420,7 +421,7 @@ func (as SqlOAuthStore) RemoveAccessData(token string) StoreChannel { func (as SqlOAuthStore) SaveAuthData(authData *model.AuthData) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -447,7 +448,7 @@ func (as SqlOAuthStore) SaveAuthData(authData *model.AuthData) StoreChannel { func (as SqlOAuthStore) GetAuthData(code string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -469,7 +470,7 @@ func (as SqlOAuthStore) GetAuthData(code string) StoreChannel { } func (as SqlOAuthStore) RemoveAuthData(code string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -487,7 +488,7 @@ func (as SqlOAuthStore) RemoveAuthData(code string) StoreChannel { } func (as SqlOAuthStore) PermanentDeleteAuthDataByUser(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} diff --git a/store/sql_post_store.go b/store/sql_post_store.go index 3b7e9d97a..212492df0 100644 --- a/store/sql_post_store.go +++ b/store/sql_post_store.go @@ -48,7 +48,7 @@ func (s SqlPostStore) CreateIndexesIfNotExists() { } func (s SqlPostStore) Save(post *model.Post) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -95,7 +95,7 @@ func (s SqlPostStore) Save(post *model.Post) StoreChannel { } func (s SqlPostStore) Update(oldPost *model.Post, newMessage string, newHashtags string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -140,7 +140,7 @@ func (s SqlPostStore) Update(oldPost *model.Post, newMessage string, newHashtags } func (s SqlPostStore) GetFlaggedPosts(userId string, offset int, limit int) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} pl := &model.PostList{} @@ -165,7 +165,7 @@ func (s SqlPostStore) GetFlaggedPosts(userId string, offset int, limit int) Stor } func (s SqlPostStore) Get(id string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -211,7 +211,7 @@ type etagPosts struct { } func (s SqlPostStore) GetEtag(channelId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -232,7 +232,7 @@ func (s SqlPostStore) GetEtag(channelId string) StoreChannel { } func (s SqlPostStore) Delete(postId string, time int64) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -250,7 +250,7 @@ func (s SqlPostStore) Delete(postId string, time int64) StoreChannel { } func (s SqlPostStore) permanentDelete(postId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -268,7 +268,7 @@ func (s SqlPostStore) permanentDelete(postId string) StoreChannel { } func (s SqlPostStore) permanentDeleteAllCommentByUser(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -286,7 +286,7 @@ func (s SqlPostStore) permanentDeleteAllCommentByUser(userId string) StoreChanne } func (s SqlPostStore) PermanentDeleteByUser(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -343,7 +343,7 @@ func (s SqlPostStore) PermanentDeleteByUser(userId string) StoreChannel { } func (s SqlPostStore) GetPosts(channelId string, offset int, limit int) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -390,7 +390,7 @@ func (s SqlPostStore) GetPosts(channelId string, offset int, limit int) StoreCha } func (s SqlPostStore) GetPostsSince(channelId string, time int64) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -456,7 +456,7 @@ func (s SqlPostStore) GetPostsAfter(channelId string, postId string, numPosts in } func (s SqlPostStore) getPostsAround(channelId string, postId string, numPosts int, offset int, before bool) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -546,7 +546,7 @@ func (s SqlPostStore) getPostsAround(channelId string, postId string, numPosts i } func (s SqlPostStore) getRootPosts(channelId string, offset int, limit int) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -567,7 +567,7 @@ func (s SqlPostStore) getRootPosts(channelId string, offset int, limit int) Stor } func (s SqlPostStore) getParentsPosts(channelId string, offset int, limit int) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -624,7 +624,7 @@ var specialSearchChar = []string{ } func (s SqlPostStore) Search(teamId string, userId string, params *model.SearchParams) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -807,7 +807,7 @@ func (s SqlPostStore) Search(teamId string, userId string, params *model.SearchP } func (s SqlPostStore) AnalyticsUserCountsWithPostsByDay(teamId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -880,7 +880,7 @@ func (s SqlPostStore) AnalyticsUserCountsWithPostsByDay(teamId string) StoreChan } func (s SqlPostStore) AnalyticsPostCountsByDay(teamId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -953,7 +953,7 @@ func (s SqlPostStore) AnalyticsPostCountsByDay(teamId string) StoreChannel { } func (s SqlPostStore) AnalyticsPostCount(teamId string, mustHaveFile bool, mustHaveHashtag bool) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} diff --git a/store/sql_preference_store.go b/store/sql_preference_store.go index f6a3b64dc..e20226ce6 100644 --- a/store/sql_preference_store.go +++ b/store/sql_preference_store.go @@ -56,7 +56,7 @@ func (s SqlPreferenceStore) DeleteUnusedFeatures() { } func (s SqlPreferenceStore) Save(preferences *model.Preferences) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -178,7 +178,7 @@ func (s SqlPreferenceStore) update(transaction *gorp.Transaction, preference *mo } func (s SqlPreferenceStore) Get(userId string, category string, name string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -207,7 +207,7 @@ func (s SqlPreferenceStore) Get(userId string, category string, name string) Sto } func (s SqlPreferenceStore) GetCategory(userId string, category string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -235,7 +235,7 @@ func (s SqlPreferenceStore) GetCategory(userId string, category string) StoreCha } func (s SqlPreferenceStore) GetAll(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -262,7 +262,7 @@ func (s SqlPreferenceStore) GetAll(userId string) StoreChannel { } func (s SqlPreferenceStore) PermanentDeleteByUser(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -280,7 +280,7 @@ func (s SqlPreferenceStore) PermanentDeleteByUser(userId string) StoreChannel { } func (s SqlPreferenceStore) IsFeatureEnabled(feature, userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -305,7 +305,7 @@ func (s SqlPreferenceStore) IsFeatureEnabled(feature, userId string) StoreChanne } func (s SqlPreferenceStore) Delete(userId, category, name string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} diff --git a/store/sql_recovery_store.go b/store/sql_recovery_store.go index 80c86c67c..c43b9bbfa 100644 --- a/store/sql_recovery_store.go +++ b/store/sql_recovery_store.go @@ -29,7 +29,7 @@ func (s SqlPasswordRecoveryStore) CreateIndexesIfNotExists() { func (s SqlPasswordRecoveryStore) SaveOrUpdate(recovery *model.PasswordRecovery) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -60,7 +60,7 @@ func (s SqlPasswordRecoveryStore) SaveOrUpdate(recovery *model.PasswordRecovery) func (s SqlPasswordRecoveryStore) Delete(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -78,7 +78,7 @@ func (s SqlPasswordRecoveryStore) Delete(userId string) StoreChannel { func (s SqlPasswordRecoveryStore) Get(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -100,7 +100,7 @@ func (s SqlPasswordRecoveryStore) Get(userId string) StoreChannel { func (s SqlPasswordRecoveryStore) GetByCode(code string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} diff --git a/store/sql_session_store.go b/store/sql_session_store.go index 4ddc06302..9a377239a 100644 --- a/store/sql_session_store.go +++ b/store/sql_session_store.go @@ -36,7 +36,7 @@ func (me SqlSessionStore) CreateIndexesIfNotExists() { func (me SqlSessionStore) Save(session *model.Session) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -85,7 +85,7 @@ func (me SqlSessionStore) Save(session *model.Session) StoreChannel { func (me SqlSessionStore) Get(sessionIdOrToken string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -123,7 +123,7 @@ func (me SqlSessionStore) Get(sessionIdOrToken string) StoreChannel { } func (me SqlSessionStore) GetSessions(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { @@ -166,7 +166,7 @@ func (me SqlSessionStore) GetSessions(userId string) StoreChannel { } func (me SqlSessionStore) Remove(sessionIdOrToken string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -184,7 +184,7 @@ func (me SqlSessionStore) Remove(sessionIdOrToken string) StoreChannel { } func (me SqlSessionStore) RemoveAllSessions() StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -202,7 +202,7 @@ func (me SqlSessionStore) RemoveAllSessions() StoreChannel { } func (me SqlSessionStore) PermanentDeleteSessionsByUser(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -220,7 +220,7 @@ func (me SqlSessionStore) PermanentDeleteSessionsByUser(userId string) StoreChan } func (me SqlSessionStore) CleanUpExpiredSessions(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -239,7 +239,7 @@ func (me SqlSessionStore) CleanUpExpiredSessions(userId string) StoreChannel { } func (me SqlSessionStore) UpdateLastActivityAt(sessionId string, time int64) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -258,7 +258,7 @@ func (me SqlSessionStore) UpdateLastActivityAt(sessionId string, time int64) Sto } func (me SqlSessionStore) UpdateRoles(userId, roles string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -276,7 +276,7 @@ func (me SqlSessionStore) UpdateRoles(userId, roles string) StoreChannel { } func (me SqlSessionStore) UpdateDeviceId(id string, deviceId string, expiresAt int64) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -294,7 +294,7 @@ func (me SqlSessionStore) UpdateDeviceId(id string, deviceId string, expiresAt i } func (me SqlSessionStore) AnalyticsSessionCount() StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} diff --git a/store/sql_status_store.go b/store/sql_status_store.go index 0915ced48..4d186a30e 100644 --- a/store/sql_status_store.go +++ b/store/sql_status_store.go @@ -36,7 +36,7 @@ func (s SqlStatusStore) CreateIndexesIfNotExists() { } func (s SqlStatusStore) SaveOrUpdate(status *model.Status) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -59,7 +59,7 @@ func (s SqlStatusStore) SaveOrUpdate(status *model.Status) StoreChannel { } func (s SqlStatusStore) Get(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -90,7 +90,7 @@ func (s SqlStatusStore) Get(userId string) StoreChannel { } func (s SqlStatusStore) GetOnlineAway() StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -110,7 +110,7 @@ func (s SqlStatusStore) GetOnlineAway() StoreChannel { } func (s SqlStatusStore) GetOnline() StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -130,7 +130,7 @@ func (s SqlStatusStore) GetOnline() StoreChannel { } func (s SqlStatusStore) GetAllFromTeam(teamId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -152,7 +152,7 @@ func (s SqlStatusStore) GetAllFromTeam(teamId string) StoreChannel { } func (s SqlStatusStore) ResetAll() StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -169,7 +169,7 @@ func (s SqlStatusStore) ResetAll() StoreChannel { } func (s SqlStatusStore) GetTotalActiveUsersCount() StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -190,7 +190,7 @@ func (s SqlStatusStore) GetTotalActiveUsersCount() StoreChannel { } func (s SqlStatusStore) UpdateLastActivityAt(userId string, lastActivityAt int64) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} diff --git a/store/sql_system_store.go b/store/sql_system_store.go index 6ae350720..cb589e760 100644 --- a/store/sql_system_store.go +++ b/store/sql_system_store.go @@ -28,7 +28,7 @@ func (s SqlSystemStore) CreateIndexesIfNotExists() { func (s SqlSystemStore) Save(system *model.System) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -46,7 +46,7 @@ func (s SqlSystemStore) Save(system *model.System) StoreChannel { func (s SqlSystemStore) SaveOrUpdate(system *model.System) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -70,7 +70,7 @@ func (s SqlSystemStore) SaveOrUpdate(system *model.System) StoreChannel { func (s SqlSystemStore) Update(system *model.System) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -88,7 +88,7 @@ func (s SqlSystemStore) Update(system *model.System) StoreChannel { func (s SqlSystemStore) Get() StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -114,7 +114,7 @@ func (s SqlSystemStore) Get() StoreChannel { func (s SqlSystemStore) GetByName(name string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} diff --git a/store/sql_team_store.go b/store/sql_team_store.go index b9db80588..34a4a097d 100644 --- a/store/sql_team_store.go +++ b/store/sql_team_store.go @@ -49,7 +49,7 @@ func (s SqlTeamStore) CreateIndexesIfNotExists() { } func (s SqlTeamStore) Save(team *model.Team) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -89,7 +89,7 @@ func (s SqlTeamStore) Save(team *model.Team) StoreChannel { func (s SqlTeamStore) Update(team *model.Team) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -130,7 +130,7 @@ func (s SqlTeamStore) Update(team *model.Team) StoreChannel { func (s SqlTeamStore) UpdateDisplayName(name string, teamId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -149,7 +149,7 @@ func (s SqlTeamStore) UpdateDisplayName(name string, teamId string) StoreChannel } func (s SqlTeamStore) Get(id string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -175,7 +175,7 @@ func (s SqlTeamStore) Get(id string) StoreChannel { } func (s SqlTeamStore) GetByInviteId(inviteId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -204,7 +204,7 @@ func (s SqlTeamStore) GetByInviteId(inviteId string) StoreChannel { } func (s SqlTeamStore) GetByName(name string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -229,7 +229,7 @@ func (s SqlTeamStore) GetByName(name string) StoreChannel { } func (s SqlTeamStore) GetAll() StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -255,7 +255,7 @@ func (s SqlTeamStore) GetAll() StoreChannel { } func (s SqlTeamStore) GetTeamsByUserId(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -281,7 +281,7 @@ func (s SqlTeamStore) GetTeamsByUserId(userId string) StoreChannel { } func (s SqlTeamStore) GetAllTeamListing() StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -313,7 +313,7 @@ func (s SqlTeamStore) GetAllTeamListing() StoreChannel { } func (s SqlTeamStore) PermanentDelete(teamId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -330,7 +330,7 @@ func (s SqlTeamStore) PermanentDelete(teamId string) StoreChannel { } func (s SqlTeamStore) AnalyticsTeamCount() StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -349,7 +349,7 @@ func (s SqlTeamStore) AnalyticsTeamCount() StoreChannel { } func (s SqlTeamStore) SaveMember(member *model.TeamMember) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -390,7 +390,7 @@ func (s SqlTeamStore) SaveMember(member *model.TeamMember) StoreChannel { } func (s SqlTeamStore) UpdateMember(member *model.TeamMember) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -417,7 +417,7 @@ func (s SqlTeamStore) UpdateMember(member *model.TeamMember) StoreChannel { } func (s SqlTeamStore) GetMember(teamId string, userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -442,7 +442,7 @@ func (s SqlTeamStore) GetMember(teamId string, userId string) StoreChannel { } func (s SqlTeamStore) GetMembers(teamId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -463,7 +463,7 @@ func (s SqlTeamStore) GetMembers(teamId string) StoreChannel { } func (s SqlTeamStore) GetTeamsForUser(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -484,7 +484,7 @@ func (s SqlTeamStore) GetTeamsForUser(userId string) StoreChannel { } func (s SqlTeamStore) RemoveMember(teamId string, userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -502,7 +502,7 @@ func (s SqlTeamStore) RemoveMember(teamId string, userId string) StoreChannel { } func (s SqlTeamStore) RemoveAllMembersByTeam(teamId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -520,7 +520,7 @@ func (s SqlTeamStore) RemoveAllMembersByTeam(teamId string) StoreChannel { } func (s SqlTeamStore) RemoveAllMembersByUser(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} diff --git a/store/sql_user_store.go b/store/sql_user_store.go index 574385cd0..8ada9eb2c 100644 --- a/store/sql_user_store.go +++ b/store/sql_user_store.go @@ -53,7 +53,7 @@ func (us SqlUserStore) CreateIndexesIfNotExists() { func (us SqlUserStore) Save(user *model.User) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -93,7 +93,7 @@ func (us SqlUserStore) Save(user *model.User) StoreChannel { func (us SqlUserStore) Update(user *model.User, trustedUpdateData bool) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -169,7 +169,7 @@ func (us SqlUserStore) Update(user *model.User, trustedUpdateData bool) StoreCha } func (us SqlUserStore) UpdateLastPictureUpdate(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -190,7 +190,7 @@ func (us SqlUserStore) UpdateLastPictureUpdate(userId string) StoreChannel { } func (us SqlUserStore) UpdateUpdateAt(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -212,7 +212,7 @@ func (us SqlUserStore) UpdateUpdateAt(userId string) StoreChannel { func (us SqlUserStore) UpdatePassword(userId, hashedPassword string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -233,7 +233,7 @@ func (us SqlUserStore) UpdatePassword(userId, hashedPassword string) StoreChanne } func (us SqlUserStore) UpdateFailedPasswordAttempts(userId string, attempts int) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -253,7 +253,7 @@ func (us SqlUserStore) UpdateFailedPasswordAttempts(userId string, attempts int) func (us SqlUserStore) UpdateAuthData(userId string, service string, authData *string, email string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -298,7 +298,7 @@ func (us SqlUserStore) UpdateAuthData(userId string, service string, authData *s func (us SqlUserStore) UpdateMfaSecret(userId, secret string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -320,7 +320,7 @@ func (us SqlUserStore) UpdateMfaSecret(userId, secret string) StoreChannel { func (us SqlUserStore) UpdateMfaActive(userId string, active bool) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -342,7 +342,7 @@ func (us SqlUserStore) UpdateMfaActive(userId string, active bool) StoreChannel func (us SqlUserStore) Get(id string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -365,7 +365,7 @@ func (us SqlUserStore) Get(id string) StoreChannel { func (us SqlUserStore) GetAll() StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -386,7 +386,7 @@ func (us SqlUserStore) GetAll() StoreChannel { } func (s SqlUserStore) GetEtagForDirectProfiles(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -438,7 +438,7 @@ func (s SqlUserStore) GetEtagForDirectProfiles(userId string) StoreChannel { } func (s SqlUserStore) GetEtagForAllProfiles() StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -459,7 +459,7 @@ func (s SqlUserStore) GetEtagForAllProfiles() StoreChannel { func (us SqlUserStore) GetAllProfiles() StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -490,7 +490,7 @@ func (us SqlUserStore) GetAllProfiles() StoreChannel { } func (s SqlUserStore) GetEtagForProfiles(teamId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -511,7 +511,7 @@ func (s SqlUserStore) GetEtagForProfiles(teamId string) StoreChannel { func (us SqlUserStore) GetProfiles(teamId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -543,7 +543,7 @@ func (us SqlUserStore) GetProfiles(teamId string) StoreChannel { func (us SqlUserStore) GetDirectProfiles(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -603,7 +603,7 @@ func (us SqlUserStore) GetDirectProfiles(userId string) StoreChannel { func (us SqlUserStore) GetProfileByIds(userIds []string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -646,7 +646,7 @@ func (us SqlUserStore) GetProfileByIds(userIds []string) StoreChannel { func (us SqlUserStore) GetSystemAdminProfiles() StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -678,7 +678,7 @@ func (us SqlUserStore) GetSystemAdminProfiles() StoreChannel { func (us SqlUserStore) GetByEmail(email string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -702,7 +702,7 @@ func (us SqlUserStore) GetByEmail(email string) StoreChannel { func (us SqlUserStore) GetByAuth(authData *string, authService string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -735,7 +735,7 @@ func (us SqlUserStore) GetByAuth(authData *string, authService string) StoreChan func (us SqlUserStore) GetAllUsingAuthService(authService string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -756,7 +756,7 @@ func (us SqlUserStore) GetAllUsingAuthService(authService string) StoreChannel { func (us SqlUserStore) GetByUsername(username string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -778,7 +778,7 @@ func (us SqlUserStore) GetByUsername(username string) StoreChannel { } func (us SqlUserStore) GetForLogin(loginId string, allowSignInWithUsername, allowSignInWithEmail, ldapEnabled bool) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -819,7 +819,7 @@ func (us SqlUserStore) GetForLogin(loginId string, allowSignInWithUsername, allo } func (us SqlUserStore) VerifyEmail(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -838,7 +838,7 @@ func (us SqlUserStore) VerifyEmail(userId string) StoreChannel { } func (us SqlUserStore) GetTotalUsersCount() StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -858,7 +858,7 @@ func (us SqlUserStore) GetTotalUsersCount() StoreChannel { func (us SqlUserStore) PermanentDelete(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -876,7 +876,7 @@ func (us SqlUserStore) PermanentDelete(userId string) StoreChannel { func (us SqlUserStore) AnalyticsUniqueUserCount(teamId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -902,7 +902,7 @@ func (us SqlUserStore) AnalyticsUniqueUserCount(teamId string) StoreChannel { } func (us SqlUserStore) GetUnreadCount(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -921,7 +921,7 @@ func (us SqlUserStore) GetUnreadCount(userId string) StoreChannel { } func (us SqlUserStore) GetUnreadCountForChannel(userId string, channelId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} diff --git a/store/sql_webhook_store.go b/store/sql_webhook_store.go index a71ac6a88..7c267064b 100644 --- a/store/sql_webhook_store.go +++ b/store/sql_webhook_store.go @@ -47,7 +47,7 @@ func (s SqlWebhookStore) CreateIndexesIfNotExists() { } func (s SqlWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -81,7 +81,7 @@ func (s SqlWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) StoreChann } func (s SqlWebhookStore) GetIncoming(id string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -102,7 +102,7 @@ func (s SqlWebhookStore) GetIncoming(id string) StoreChannel { } func (s SqlWebhookStore) DeleteIncoming(webhookId string, time int64) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -120,7 +120,7 @@ func (s SqlWebhookStore) DeleteIncoming(webhookId string, time int64) StoreChann } func (s SqlWebhookStore) PermanentDeleteIncomingByUser(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -138,7 +138,7 @@ func (s SqlWebhookStore) PermanentDeleteIncomingByUser(userId string) StoreChann } func (s SqlWebhookStore) GetIncomingByTeam(teamId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -159,7 +159,7 @@ func (s SqlWebhookStore) GetIncomingByTeam(teamId string) StoreChannel { } func (s SqlWebhookStore) GetIncomingByChannel(channelId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -180,7 +180,7 @@ func (s SqlWebhookStore) GetIncomingByChannel(channelId string) StoreChannel { } func (s SqlWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -214,7 +214,7 @@ func (s SqlWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) StoreChann } func (s SqlWebhookStore) GetOutgoing(id string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -235,7 +235,7 @@ func (s SqlWebhookStore) GetOutgoing(id string) StoreChannel { } func (s SqlWebhookStore) GetOutgoingByChannel(channelId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -256,7 +256,7 @@ func (s SqlWebhookStore) GetOutgoingByChannel(channelId string) StoreChannel { } func (s SqlWebhookStore) GetOutgoingByTeam(teamId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -277,7 +277,7 @@ func (s SqlWebhookStore) GetOutgoingByTeam(teamId string) StoreChannel { } func (s SqlWebhookStore) DeleteOutgoing(webhookId string, time int64) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -295,7 +295,7 @@ func (s SqlWebhookStore) DeleteOutgoing(webhookId string, time int64) StoreChann } func (s SqlWebhookStore) PermanentDeleteOutgoingByUser(userId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -313,7 +313,7 @@ func (s SqlWebhookStore) PermanentDeleteOutgoingByUser(userId string) StoreChann } func (s SqlWebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -334,7 +334,7 @@ func (s SqlWebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) StoreChanne } func (s SqlWebhookStore) AnalyticsIncomingCount(teamId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} @@ -365,7 +365,7 @@ func (s SqlWebhookStore) AnalyticsIncomingCount(teamId string) StoreChannel { } func (s SqlWebhookStore) AnalyticsOutgoingCount(teamId string) StoreChannel { - storeChannel := make(StoreChannel) + storeChannel := make(StoreChannel, 1) go func() { result := StoreResult{} -- cgit v1.2.3-1-g7c22