mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
1d9a461c23
- Use windows.FlushFileBuffers() instead of windows.Fsync() at streamTracker.adviseDontNeed() for consistency with implementations for other architectures. - Use filepath.Base() instead of filepath.Split(), since the dir part isn't used. This simplifies the code a bit. Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/70
20 lines
372 B
Go
20 lines
372 B
Go
package filestream
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"golang.org/x/sys/windows"
|
|
)
|
|
|
|
func (st *streamTracker) adviseDontNeed(n int, fdatasync bool) error {
|
|
if fdatasync && st.fd > 0 {
|
|
if err := windows.FlushFileBuffers(windows.Handle(st.fd)); err != nil {
|
|
return fmt.Errorf("windows.Fsync error: %w", err)
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (st *streamTracker) close() error {
|
|
return nil
|
|
}
|