-
Notifications
You must be signed in to change notification settings - Fork 0
Fix how we get latest in s3 buckets #16
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
Conversation
|
|
||
| defp find_latest([_ | _] = contents, key) do | ||
| defp find_latest([_ | _] = contents) do | ||
| dbg contents |
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.
| dbg contents |
| end | ||
|
|
||
| defp find_latest(_, _), do: {:error, :not_found} | ||
| defp find_latest(_), do: {:error, :not_found} |
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.
Are you matching on this :not_found somewhere? Otherwise I think we should either:
- use a more descriptive string, something like "object @ #{key} was not found"
- introduce an Exception that will produce a similar message to the string above
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.
yes we match on it already when we call find_latest:
{:error, :not_found} ->
{:error, "could not find s3://#{state.bucket}/#{state.key}"}
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.
perfect
sneako
left a comment
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.
can you please just increment the patch version? then we can merge and publish this
|
oh yea ofc! |
We thought to spread out the changes of my original pr into several.
This will use the is_latest tag, and also passes in the prefix so that we only lookup the correct object instead of listing all objects in the whole bucket.
I tested and can see the even buckets that are not versioned will return is_latest for an object. e.g for appmonet.com bucket :