Merge pull request #286 from hashicorp/box-set-last-update

Update timestamp whenever a box is updated
This commit is contained in:
Sophia Castellarin 2022-06-13 08:42:55 -05:00 committed by GitHub
commit 708b688b3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ import (
"github.com/hashicorp/vagrant/internal/server/proto/vagrant_server"
"google.golang.org/protobuf/types/known/emptypb"
"google.golang.org/protobuf/types/known/timestamppb"
)
func (s *service) ListBoxes(
@ -44,6 +45,7 @@ func (s *service) UpsertBox(
req *vagrant_server.UpsertBoxRequest,
) (*vagrant_server.UpsertBoxResponse, error) {
result := req.Box
result.LastUpdate = timestamppb.Now()
if err := s.state.BoxPut(result); err != nil {
return nil, err
}