diff options
author | Kyo Nguyen <canhlinh.lienson@gmail.com> | 2016-09-19 19:30:41 +0700 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-09-19 08:30:41 -0400 |
commit | 2ca751febff968ddad65a7f55bffde631392c093 (patch) | |
tree | 3532d88bf33b1a78e2327c0e074a0ea1d669d4e1 /store/sql_oauth_store.go | |
parent | 33eda94db33417c839499b1b3e0330a4fdd1de19 (diff) | |
download | chat-2ca751febff968ddad65a7f55bffde631392c093.tar.gz chat-2ca751febff968ddad65a7f55bffde631392c093.tar.bz2 chat-2ca751febff968ddad65a7f55bffde631392c093.zip |
Fix leaking goroutines in store calls (#3993). (#4021)
Diffstat (limited to 'store/sql_oauth_store.go')
-rw-r--r-- | store/sql_oauth_store.go | 39 |
1 files changed, 20 insertions, 19 deletions
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{} |