feat(t242): delete unused freight orders
This commit is contained in:
@@ -169,6 +169,20 @@ func (service *FreightImageService) deleteStoredImage(storageKey string) {
|
||||
_ = service.store.Delete(ctx, storageKey)
|
||||
}
|
||||
|
||||
func (service *FreightImageService) DeleteStoredImages(storageKeys []string) {
|
||||
if len(storageKeys) == 0 {
|
||||
return
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(context.Background(), freightImageCleanup)
|
||||
defer cancel()
|
||||
for _, storageKey := range storageKeys {
|
||||
if ctx.Err() != nil {
|
||||
return
|
||||
}
|
||||
_ = service.store.Delete(ctx, storageKey)
|
||||
}
|
||||
}
|
||||
|
||||
func (service *FreightImageService) OpenItemImage(
|
||||
ctx context.Context,
|
||||
creatorSubject, itemID string,
|
||||
|
||||
Reference in New Issue
Block a user