-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recording/change s3 on close mechanism #388
Conversation
3cecc3c
to
f587874
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #388 +/- ##
==========================================
+ Coverage 54.04% 54.17% +0.12%
==========================================
Files 74 75 +1
Lines 3249 3258 +9
==========================================
+ Hits 1756 1765 +9
Misses 1493 1493
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
recording/lib/storage/s3.ex
Outdated
defp stream_object(file_path, config, storage_opts) do | ||
path_prefix = Map.get(storage_opts, :path_prefix, "") | ||
path = Path.join([path_prefix, config.filename]) | ||
credentials = storage_opts.credentials | ||
aws_config = create_aws_config(credentials) | ||
|
||
result = | ||
file_path | ||
|> ExAws.S3.Upload.stream_file() | ||
|> ExAws.S3.upload(credentials.bucket, path) | ||
|> ExAws.request(aws_config) | ||
|
||
case result do | ||
{:ok, %{status_code: 200}} -> | ||
:ok | ||
|
||
{:error, response} -> | ||
Membrane.Logger.error( | ||
"Couldn't stream object on S3 bucket, recording id: #{config.recording_id}" | ||
) | ||
|
||
{:error, response} | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty similar to save_object
, only the inner path is different. Could we avoid duplication of the code?
No description provided.