diff --git a/internal/caches/storage_file.go b/internal/caches/storage_file.go index 8ba5a0f..3c181a9 100644 --- a/internal/caches/storage_file.go +++ b/internal/caches/storage_file.go @@ -208,6 +208,9 @@ func (this *FileStorage) OpenReader(key string) (Reader, error) { return this.openReader(key, true) } +var cacheMap = map[string][]*os.File{} +var cacheMapLocker = ysnc. + func (this *FileStorage) openReader(key string, allowMemory bool) (Reader, error) { // 先尝试内存缓存 if allowMemory && this.memoryStorage != nil { diff --git a/internal/nodes/listener_http.go b/internal/nodes/listener_http.go index c9679f9..b53be84 100644 --- a/internal/nodes/listener_http.go +++ b/internal/nodes/listener_http.go @@ -47,8 +47,8 @@ func (this *HTTPListener) Serve() error { this.httpServer = &http.Server{ Addr: this.addr, Handler: this, - ReadHeaderTimeout: 2 * time.Second, // TODO 改成可以配置 - IdleTimeout: 2 * time.Minute, // TODO 改成可以配置 + ReadHeaderTimeout: 3 * time.Second, // TODO 改成可以配置 + IdleTimeout: 75 * time.Second, // TODO 改成可以配置 ConnState: func(conn net.Conn, state http.ConnState) { switch state { case http.StateNew: