From 3c4561113be851927178b1163412597bcb32dbbe Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 30 Jun 2023 15:04:47 +0300 Subject: [PATCH] Remove long wait for semaphore --- attachments.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/attachments.go b/attachments.go index 85a51a9..875917e 100644 --- a/attachments.go +++ b/attachments.go @@ -284,13 +284,8 @@ func (br *DiscordBridge) copyAttachmentToMatrix(intent *appservice.IntentAPI, ur cancel() if onceErr != nil { br.ZLog.Warn().Err(onceErr).Msg("Failed to acquire semaphore") - ctx, cancel = context.WithTimeout(context.Background(), 50*time.Second) - onceErr = br.parallelAttachmentSemaphore.Acquire(ctx, attachmentSizeVal) - cancel() - if onceErr != nil { - onceErr = fmt.Errorf("reuploading timed out") - return - } + onceErr = fmt.Errorf("reuploading timed out") + return } var semaWg sync.WaitGroup semaWg.Add(1)