feat(t242): delete unused freight orders

This commit is contained in:
QiuSW
2026-07-29 16:10:45 +08:00
parent c80a5c26ed
commit e5f403ff7d
20 changed files with 915 additions and 27 deletions
@@ -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,