diff options
author | Jack <jackdeng@gmail.com> | 2015-09-28 08:14:57 -0700 |
---|---|---|
committer | Jack <jackdeng@gmail.com> | 2015-09-28 08:14:57 -0700 |
commit | 503501ab3b616fb9fa57b046df850cfc2db734f8 (patch) | |
tree | 43e529250bab982c73816f1ffdf673e8e4b98c13 /store/sql_session_store.go | |
parent | aa6da728baf2f5642293d8b56ebc1ff4e8682bce (diff) | |
parent | a055fd10b83b28bf97877e4e28a2275f74a71a4a (diff) | |
download | chat-503501ab3b616fb9fa57b046df850cfc2db734f8.tar.gz chat-503501ab3b616fb9fa57b046df850cfc2db734f8.tar.bz2 chat-503501ab3b616fb9fa57b046df850cfc2db734f8.zip |
rebase
Diffstat (limited to 'store/sql_session_store.go')
-rw-r--r-- | store/sql_session_store.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/store/sql_session_store.go b/store/sql_session_store.go index c1d2c852b..22411389d 100644 --- a/store/sql_session_store.go +++ b/store/sql_session_store.go @@ -140,6 +140,24 @@ func (me SqlSessionStore) Remove(sessionIdOrToken string) StoreChannel { return storeChannel } +func (me SqlSessionStore) RemoveAllSessionsForTeam(teamId string) StoreChannel { + storeChannel := make(StoreChannel) + + go func() { + result := StoreResult{} + + _, err := me.GetMaster().Exec("DELETE FROM Sessions WHERE TeamId = :TeamId", map[string]interface{}{"TeamId": teamId}) + if err != nil { + result.Err = model.NewAppError("SqlSessionStore.RemoveAllSessionsForTeam", "We couldn't remove all the sessions for the team", "id="+teamId+", err="+err.Error()) + } + + storeChannel <- result + close(storeChannel) + }() + + return storeChannel +} + func (me SqlSessionStore) CleanUpExpiredSessions(userId string) StoreChannel { storeChannel := make(StoreChannel) |