Update MTPROXY_CHECK_TIMEOUT to 45s in docker-compose and documentation; adjust default timeout handling in code for improved performance under slow network conditions.
This commit is contained in:
@@ -3,6 +3,7 @@ package checkresult
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"net"
|
||||
|
||||
"mtproxy_checker/internal/checker"
|
||||
)
|
||||
@@ -18,5 +19,9 @@ func Classify(err error) (exitCode int, message string) {
|
||||
if errors.Is(err, context.DeadlineExceeded) {
|
||||
return 4, "timeout"
|
||||
}
|
||||
var ne net.Error
|
||||
if errors.As(err, &ne) && ne.Timeout() {
|
||||
return 4, "timeout"
|
||||
}
|
||||
return 1, err.Error()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user