Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

fix: fill/rename LastVerified -> LastUpdated in replica #136

Merged
merged 2 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/server/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (m *HttpServer) handleBlobGetStatusByID(w http.ResponseWriter, r *http.Requ
response.Replicas = append(response.Replicas, api.Replica{
Provider: replica.Provider,
Status: replica.Status,
LastVerified: replica.LastVerified,
LastVerified: replica.LastUpdated,
Expiration: replica.Expiration,
})
}
Expand Down
8 changes: 4 additions & 4 deletions blob/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ type (
Replicas []Replica
}
Replica struct {
Provider string
Status string
LastVerified time.Time
Expiration time.Time
Provider string
Status string
LastUpdated time.Time
Expiration time.Time
}
Store interface {
Put(context.Context, io.ReadCloser) (*Descriptor, error)
Expand Down
13 changes: 9 additions & 4 deletions integration/singularity/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,16 @@ func (s *SingularityStore) Describe(ctx context.Context, id blob.ID) (*blob.Desc
}
replicas := make([]blob.Replica, 0, len(getFileDealsRes.Payload))
for _, deal := range getFileDealsRes.Payload {
updatedAt, err := time.Parse("2006-01-02 15:04:05-07:00", deal.UpdatedAt)
if err != nil {
updatedAt = time.Time{}
}

replicas = append(replicas, blob.Replica{
// TODO: figure out how to get LastVerified
Provider: deal.Provider,
Status: string(deal.State),
Expiration: epochutil.EpochToTime(int32(deal.EndEpoch)),
LastUpdated: updatedAt,
Provider: deal.Provider,
Status: string(deal.State),
Expiration: epochutil.EpochToTime(int32(deal.EndEpoch)),
})
}
descriptor.Status = &blob.Status{
Expand Down