Skip to content

Commit

Permalink
Embedding transfer ID in the generated manifest filename (because we …
Browse files Browse the repository at this point in the history
…can).

Closes #74
  • Loading branch information
jeff-cohere committed Aug 12, 2024
1 parent 5763a85 commit 39e4bf3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,16 @@ func (task *taskType) checkTransfer() error {
if err != nil {
return fmt.Errorf("marshalling manifest content: %s", err.Error())
}
var manifestFile *os.File
manifestFile, err = os.CreateTemp(config.Service.ManifestDirectory,
"manifest.json")
task.ManifestFile = filepath.Join(config.Service.ManifestDirectory,
fmt.Sprintf("manifest-%s.json", task.Id.String()))
manifestFile, err := os.Create(task.ManifestFile)
if err != nil {
return fmt.Errorf("creating manifest file: %s", err.Error())
}
_, err = manifestFile.Write(manifestBytes)
if err != nil {
return fmt.Errorf("writing manifest file content: %s", err.Error())
}
task.ManifestFile = manifestFile.Name()
err = manifestFile.Close()
if err != nil {
return fmt.Errorf("closing manifest file: %s", err.Error())
Expand Down

0 comments on commit 39e4bf3

Please sign in to comment.