From 39e4bf3d26422bc96806d34ddec517a4699f2446 Mon Sep 17 00:00:00 2001 From: "Jeffrey N. Johnson" Date: Mon, 12 Aug 2024 10:06:25 -0700 Subject: [PATCH] Embedding transfer ID in the generated manifest filename (because we can). Closes #74 --- tasks/tasks.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tasks/tasks.go b/tasks/tasks.go index 208734c6..d6693920 100644 --- a/tasks/tasks.go +++ b/tasks/tasks.go @@ -328,9 +328,9 @@ 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()) } @@ -338,7 +338,6 @@ func (task *taskType) checkTransfer() error { 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())