Implement S3 Lifecycle Policy for Temporary Audio Cleanup and Error Handling (Fixes #172) #174
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Description
Title: Implement S3 Lifecycle Policy for Temporary Audio Cleanup and Error Handling
Background:
This pull request addresses the issue identified in Issue #172, which highlights the problem of temporary audio files stored in S3 remaining indefinitely after transcription failures or interruptions. This behavior poses risks including unnecessary storage costs, potential security vulnerabilities, and violations of data retention policies.
Objective:
The main objective of this implementation is to ensure that temporary audio files in the
audiotranscribetemp
bucket are automatically cleaned up after a defined period, regardless of the transcription outcome.Summary of Changes:
New File Creation:
aws_services.py
file within theutils
directory dedicated to managing S3 operations.S3Service Class:
S3Service
class, which includes methods for:Lifecycle Policy Configuration:
Code Modifications:
create_s3_bucket_if_not_exists
method inservices.py
to incorporate the lifecycle policy setup.Benefits of Implementation:
This pull request effectively resolves the issues presented in the original request, ensuring more efficient and compliant management of audio files in S3.
Fixes #172.
We appreciate your review and feedback on this implementation. Thank you!