From 1b295bc7e23233cadf87d8be077c67702a72ca75 Mon Sep 17 00:00:00 2001 From: LexLuthr <88259624+LexLuthr@users.noreply.github.com> Date: Thu, 27 Jun 2024 23:29:07 +0400 Subject: [PATCH] fix toml decode and paramfetch (#71) --- deps/config/types.go | 5 +++++ lib/fastparamfetch/paramfetch.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/deps/config/types.go b/deps/config/types.go index 7f5f2c979..56bf981cb 100644 --- a/deps/config/types.go +++ b/deps/config/types.go @@ -342,6 +342,11 @@ type CurioProvingConfig struct { // for decoding and encoding from/to TOML type Duration time.Duration +func (dur Duration) MarshalText() ([]byte, error) { + d := time.Duration(dur) + return []byte(d.String()), nil +} + // UnmarshalText implements interface for TOML decoding func (dur *Duration) UnmarshalText(text []byte) error { d, err := time.ParseDuration(string(text)) diff --git a/lib/fastparamfetch/paramfetch.go b/lib/fastparamfetch/paramfetch.go index 3a86d83dc..46e7290a3 100644 --- a/lib/fastparamfetch/paramfetch.go +++ b/lib/fastparamfetch/paramfetch.go @@ -307,7 +307,7 @@ func fetchWithAria2c(ctx context.Context, out, url string) error { return xerrors.New("aria2c not found in PATH") } - cmd := exec.CommandContext(ctx, aria2cPath, "--continue", "-x16", "-s16", "-dir", filepath.Dir(out), "-o", filepath.Base(out), url) + cmd := exec.CommandContext(ctx, aria2cPath, "--continue", "-x16", "-s16", "--dir", filepath.Dir(out), "-o", filepath.Base(out), url) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr