feat: optimize caching strategy and implement concurrency limits
This commit is contained in:
@@ -1,8 +1,20 @@
|
||||
package utils
|
||||
|
||||
import "io"
|
||||
import (
|
||||
"io"
|
||||
)
|
||||
|
||||
type SizeReadCloser struct {
|
||||
io.ReadCloser
|
||||
Size uint64
|
||||
}
|
||||
|
||||
type CloserWrapper struct {
|
||||
io.ReadCloser
|
||||
OnClose func()
|
||||
}
|
||||
|
||||
func (c *CloserWrapper) Close() error {
|
||||
defer c.OnClose()
|
||||
return c.ReadCloser.Close()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user