Skip to content
Discussion options

You must be logged in to vote

Hello @gabrielecalafange!
The aws_prices collection is currently used as a cache layer into insider's flavor_price api, reducing a number of requests made to AWS.

price_infos = list(self.prices_collection.find(query))
if not price_infos:
query.pop('updated_at', None)
price_infos = self.cloud_adapter.get_prices(query)
updates = []
for price_info in price_infos:
price_info['updated_at'] = now
updates.append(UpdateOne(
filter={'sku': price_info['sku']},
update={'$set': price_info},
upsert=True,
))
if updates:
self.prices_collection.b…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gabrielecalafange
Comment options

Answer selected by nk-hystax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants