summaryrefslogtreecommitdiffstats
path: root/bridge/slack/slack.go
diff options
context:
space:
mode:
authorPatrick Connolly <patrick.c.connolly@gmail.com>2018-11-15 04:00:21 +0800
committerWim <wim@42.be>2018-11-14 21:00:21 +0100
commit09713d40ba8b78671964efe83cdd1da124d44114 (patch)
treeb6e46c15a5fa2b7f849b722096e492cf3978f3e5 /bridge/slack/slack.go
parent16d5aeac7c2de010d30cddc90c5755ac5b989b2b (diff)
downloadmatterbridge-msglm-09713d40ba8b78671964efe83cdd1da124d44114.tar.gz
matterbridge-msglm-09713d40ba8b78671964efe83cdd1da124d44114.tar.bz2
matterbridge-msglm-09713d40ba8b78671964efe83cdd1da124d44114.zip
Fix file caching issue (slack). #572 (#575)
Diffstat (limited to 'bridge/slack/slack.go')
-rw-r--r--bridge/slack/slack.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go
index 8030eb9c..1f51de95 100644
--- a/bridge/slack/slack.go
+++ b/bridge/slack/slack.go
@@ -384,9 +384,7 @@ func (b *Bslack) uploadFile(msg *config.Message, channelID string) {
// we can't match on the file ID yet, so we have to match on the filename too.
ts := time.Now()
b.Log.Debugf("Adding file %s to cache at %s with timestamp", fi.Name, ts.String())
- if !b.cache.Add("filename"+fi.Name, ts) {
- b.Log.Warnf("Failed to add file %s to cache at %s with timestamp", fi.Name, ts.String())
- }
+ b.cache.Add("filename"+fi.Name, ts)
res, err := b.sc.UploadFile(slack.FileUploadParameters{
Reader: bytes.NewReader(*fi.Data),
Filename: fi.Name,
@@ -399,9 +397,7 @@ func (b *Bslack) uploadFile(msg *config.Message, channelID string) {
}
if res.ID != "" {
b.Log.Debugf("Adding file ID %s to cache with timestamp %s", res.ID, ts.String())
- if !b.cache.Add("file"+res.ID, ts) {
- b.Log.Warnf("Failed to add file ID %s to cache with timestamp %s", res.ID, ts.String())
- }
+ b.cache.Add("file"+res.ID, ts)
}
}
}