Skip to content

Commit

Permalink
fix toml decode and paramfetch (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
LexLuthr committed Jun 27, 2024
1 parent 2b4ed70 commit 1b295bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions deps/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion lib/fastparamfetch/paramfetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1b295bc

Please sign in to comment.