Skip to content

Commit

Permalink
feat: Removing sleep for discord
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Nov 20, 2023
1 parent acd8b99 commit 87c0ebc
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions pkg/webhook/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
"github.com/ViBiOh/httputils/v4/pkg/request"
)

const pubsubThumbnailDiscordDelay = 10 * time.Second

func (s *Service) EventConsumer(ctx context.Context, event provider.Event) {
s.mutex.RLock()
defer s.mutex.RUnlock()
Expand Down Expand Up @@ -115,11 +113,6 @@ func (s *Service) discordHandle(ctx context.Context, webhook provider.Webhook, e
Fields: fields,
}

if s.redisClient != nil {
// Waiting a couple of seconds before checking for thumbnail
time.Sleep(pubsubThumbnailDiscordDelay)
}

if s.thumbnail.HasThumbnail(ctx, event.Item, thumbnail.SmallSize) {
thumbnailURL := event.GetURL() + "?thumbnail"

Expand Down

0 comments on commit 87c0ebc

Please sign in to comment.