Explorar o código

reduce waiting time on sniffing

Darien Raymond %!s(int64=7) %!d(string=hai) anos
pai
achega
ce96941029
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  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)
 		}
 	}
 }