]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Minor storage tweaks
authorMatt Joiner <anacrolix@gmail.com>
Mon, 26 May 2025 07:13:35 +0000 (17:13 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 26 May 2025 07:13:35 +0000 (17:13 +1000)
storage/file-client.go

index 406684c42140754546356bbacc19a3bf9096a80e..a912fda2242d027c138ca07379033e4f0d361d9b 100644 (file)
@@ -27,6 +27,8 @@ type NewFileClientOpts struct {
        ClientBaseDir   string
        FilePathMaker   FilePathMaker
        TorrentDirMaker TorrentDirFilePathMaker
+       // If part files are enabled, this will default to inferring completion from file names at
+       // startup, and keep the rest in memory.
        PieceCompletion PieceCompletion
        UsePartFiles    g.Option[bool]
        Logger          *slog.Logger
@@ -59,7 +61,7 @@ func NewFileOpts(opts NewFileClientOpts) ClientImplCloser {
                }
        }
        if opts.Logger == nil {
-               opts.Logger = log.Default.Slogger()
+               opts.Logger = slog.Default()
        }
        return &fileClientImpl{opts}
 }