Skip to content

Commit

Permalink
Persist created and updated time in compose
Browse files Browse the repository at this point in the history
Also use the correct time format
  • Loading branch information
gaul committed Nov 25, 2024
1 parent 9e26890 commit f96640f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion internal/backend/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,14 @@ func (s *storageFS) ComposeObject(bucketName string, objectNames []string, desti
sourceObjects = append(sourceObjects, obj)
}

now := time.Now().Format(timestampFormat)
dest := StreamingObject{
ObjectAttrs: ObjectAttrs{
BucketName: bucketName,
Name: destinationName,
ContentType: contentType,
Created: time.Now().String(),
Created: now,
Updated: now,
},
}

Expand Down
4 changes: 3 additions & 1 deletion internal/backend/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,14 @@ func (s *storageMemory) ComposeObject(bucketName string, objectNames []string, d
var dest Object
streamingDest, err := s.GetObject(bucketName, destinationName)
if err != nil {
now := time.Now().Format(timestampFormat)
dest = Object{
ObjectAttrs: ObjectAttrs{
BucketName: bucketName,
Name: destinationName,
ContentType: contentType,
Created: time.Now().String(),
Created: now,
Updated: now,
},
}
} else {
Expand Down

0 comments on commit f96640f

Please sign in to comment.