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

Commit

Permalink
fix: fill/rename LastVerified -> LastUpdated in replica (#136)
Browse files Browse the repository at this point in the history
closes #132 
closes #137
  • Loading branch information
elijaharita authored Oct 6, 2023
1 parent c38b9f6 commit 5cfdd22
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
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

0 comments on commit 5cfdd22

Please sign in to comment.