瀏覽代碼

reduce waiting time on sniffing

Darien Raymond 7 年之前
父節點
當前提交
ce96941029
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      app/dispatcher/default.go

+ 1 - 2
app/dispatcher/default.go

@@ -205,7 +205,7 @@ func sniffer(ctx context.Context, cReader *cachedReader) (SniffResult, error) {
 			return nil, ctx.Err()
 		default:
 			totalAttempt++
-			if totalAttempt > 5 {
+			if totalAttempt > 2 {
 				return nil, errSniffingTimeout
 			}
 
@@ -219,7 +219,6 @@ func sniffer(ctx context.Context, cReader *cachedReader) (SniffResult, error) {
 			if payload.IsFull() {
 				return nil, errUnknownContent
 			}
-			time.Sleep(time.Millisecond * 100)
 		}
 	}
 }