diff options
author | Chocobozzz <me@florianbigard.com> | 2022-10-25 14:18:59 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-10-25 14:18:59 +0200 |
commit | aa887096f9a305568dc3a846d0c9cdf7e45f1c67 (patch) | |
tree | 5dc455d680ebdd24644ebe29b2f129afb903b421 /server/lib/object-storage/shared | |
parent | 508c1b1e9f3b26752a961e945b7fa59b72b30827 (diff) | |
download | PeerTube-aa887096f9a305568dc3a846d0c9cdf7e45f1c67.tar.gz PeerTube-aa887096f9a305568dc3a846d0c9cdf7e45f1c67.tar.zst PeerTube-aa887096f9a305568dc3a846d0c9cdf7e45f1c67.zip |
Correctly delete live files from object storage
Diffstat (limited to 'server/lib/object-storage/shared')
-rw-r--r-- | server/lib/object-storage/shared/object-storage-helpers.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/server/lib/object-storage/shared/object-storage-helpers.ts b/server/lib/object-storage/shared/object-storage-helpers.ts index d13c25798..3046d76bc 100644 --- a/server/lib/object-storage/shared/object-storage-helpers.ts +++ b/server/lib/object-storage/shared/object-storage-helpers.ts | |||
@@ -110,11 +110,15 @@ function updatePrefixACL (options: { | |||
110 | function removeObject (objectStorageKey: string, bucketInfo: BucketInfo) { | 110 | function removeObject (objectStorageKey: string, bucketInfo: BucketInfo) { |
111 | const key = buildKey(objectStorageKey, bucketInfo) | 111 | const key = buildKey(objectStorageKey, bucketInfo) |
112 | 112 | ||
113 | logger.debug('Removing file %s in bucket %s', key, bucketInfo.BUCKET_NAME, lTags()) | 113 | return removeObjectByFullKey(key, bucketInfo) |
114 | } | ||
115 | |||
116 | function removeObjectByFullKey (fullKey: string, bucketInfo: BucketInfo) { | ||
117 | logger.debug('Removing file %s in bucket %s', fullKey, bucketInfo.BUCKET_NAME, lTags()) | ||
114 | 118 | ||
115 | const command = new DeleteObjectCommand({ | 119 | const command = new DeleteObjectCommand({ |
116 | Bucket: bucketInfo.BUCKET_NAME, | 120 | Bucket: bucketInfo.BUCKET_NAME, |
117 | Key: key | 121 | Key: fullKey |
118 | }) | 122 | }) |
119 | 123 | ||
120 | return getClient().send(command) | 124 | return getClient().send(command) |
@@ -195,6 +199,7 @@ export { | |||
195 | storeObject, | 199 | storeObject, |
196 | 200 | ||
197 | removeObject, | 201 | removeObject, |
202 | removeObjectByFullKey, | ||
198 | removePrefix, | 203 | removePrefix, |
199 | 204 | ||
200 | makeAvailable, | 205 | makeAvailable, |