summaryrefslogtreecommitdiffstats
path: root/api/file.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-10-20 07:58:05 -0400
committerJoram Wilander <jwawilander@gmail.com>2015-10-20 07:58:05 -0400
commit7d8e08ccf6211d3df78eb6cfd4a198df77072540 (patch)
tree8703ffd97990c74e60360b6ddba811eb0065eea1 /api/file.go
parent88b3aa4d80e7ee540083f897cdce3f9634c4a8f9 (diff)
parent04bf527966db559523fb0ec317af5076241f1bc5 (diff)
downloadchat-7d8e08ccf6211d3df78eb6cfd4a198df77072540.tar.gz
chat-7d8e08ccf6211d3df78eb6cfd4a198df77072540.tar.bz2
chat-7d8e08ccf6211d3df78eb6cfd4a198df77072540.zip
Merge pull request #1095 from rgarmsen2295/plt-661
PLT-661 Changed all goroutine functions to use '...AndForget' as the naming convention
Diffstat (limited to 'api/file.go')
-rw-r--r--api/file.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/api/file.go b/api/file.go
index 429347596..142ef7ac7 100644
--- a/api/file.go
+++ b/api/file.go
@@ -146,12 +146,12 @@ func uploadFile(c *Context, w http.ResponseWriter, r *http.Request) {
resStruct.ClientIds = append(resStruct.ClientIds, clientId)
}
- fireAndForgetHandleImages(imageNameList, imageDataList, c.Session.TeamId, channelId, c.Session.UserId)
+ handleImagesAndForget(imageNameList, imageDataList, c.Session.TeamId, channelId, c.Session.UserId)
w.Write([]byte(resStruct.ToJson()))
}
-func fireAndForgetHandleImages(filenames []string, fileData [][]byte, teamId, channelId, userId string) {
+func handleImagesAndForget(filenames []string, fileData [][]byte, teamId, channelId, userId string) {
go func() {
dest := "teams/" + teamId + "/channels/" + channelId + "/users/" + userId + "/"
@@ -311,7 +311,7 @@ func getFileInfo(c *Context, w http.ResponseWriter, r *http.Request) {
} else {
fileData := make(chan []byte)
- asyncGetFile(path, fileData)
+ getFileAndForget(path, fileData)
f := <-fileData
@@ -378,7 +378,7 @@ func getFile(c *Context, w http.ResponseWriter, r *http.Request) {
}
fileData := make(chan []byte)
- asyncGetFile(path, fileData)
+ getFileAndForget(path, fileData)
if len(hash) > 0 && len(data) > 0 && len(teamId) == 26 {
if !model.ComparePassword(hash, fmt.Sprintf("%v:%v", data, utils.Cfg.FileSettings.PublicLinkSalt)) {
@@ -423,7 +423,7 @@ func getFile(c *Context, w http.ResponseWriter, r *http.Request) {
w.Write(f)
}
-func asyncGetFile(path string, fileData chan []byte) {
+func getFileAndForget(path string, fileData chan []byte) {
go func() {
data, getErr := readFile(path)
if getErr != nil {