소스 검색

Remove long wait for semaphore

Tulir Asokan 2 년 전
부모
커밋
3c4561113b
1개의 변경된 파일2개의 추가작업 그리고 7개의 파일을 삭제
  1. 2 7
      attachments.go

+ 2 - 7
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)