-
Notifications
You must be signed in to change notification settings - Fork 19
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
Write to multiple buckets. #356
Write to multiple buckets. #356
Conversation
By configuring the store bucket name as a list, this adds the ability to write to that list of buckets in order.
tilequeue/store.py
Outdated
|
||
# if buckets are given as a list, then write to each of them and read from | ||
# the last one. this behaviour is captures in MultiStore. | ||
if isinstance(bucket_name, list): |
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.
It might be good to make sure we still have a test that covers the single-string bucket case. I've been bitten a couple times before by the fact that Python considers a string an iterable and it acts as a list of characters. Your isinstance(bucket_name, list)
check here will protect against that, but I could see it inadvertently getting streamlined into a iterable-ness check in the future.
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.
Good point - added test for that in 078c26a.
tilequeue/store.py
Outdated
delete_retry_interval, logger, object_acl, tags, tile_key_gen) | ||
|
||
# if buckets are given as a list, then write to each of them and read from | ||
# the last one. this behaviour is captures in MultiStore. |
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.
nit: captured
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.
Well spotted! Fixed in d3f8277.
… is treated like a single-item list, not by iterating over each character.
By configuring the store bucket name as a list, this adds the ability to write to that list of buckets in order.
Connects to #353.