Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
This commit is contained in:
Mohammed Al Sahaf 2025-06-02 20:07:20 +03:00
parent 9d3e9e7826
commit 6cc2f7b581
No known key found for this signature in database

View File

@ -26,10 +26,10 @@ import (
"sync" "sync"
"time" "time"
"github.com/rosedblabs/wal"
"github.com/caddyserver/caddy/v2" "github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile" "github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/rosedblabs/wal"
) )
func init() { func init() {
@ -184,7 +184,7 @@ func (nw *NetWriter) saveLastProcessedChunk(chunk uint32) {
metaFile := filepath.Join(nw.walDir, "last_processed") metaFile := filepath.Join(nw.walDir, "last_processed")
data := fmt.Sprintf("%d", chunk) data := fmt.Sprintf("%d", chunk)
if err := os.WriteFile(metaFile, []byte(data), 0o644); err != nil { if err := os.WriteFile(metaFile, []byte(data), 0o600); err != nil {
nw.logger.Error("failed to save last processed chunk", "error", err) nw.logger.Error("failed to save last processed chunk", "error", err)
} }
} }