[Waiting on #174] WIP - Add rake task to sync items with Amazon #175
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.
Resolves #62 (part 3/3)
Description
I broke #62 into three PRs for easier review: this is the final piece. (part 1: #173, part 2: #174)
Now that we have the new endpoint, I can add a rake task (
rake items:sync
) to go through and sync the local items with Amazon. The real work happens inItemSyncJob
. In order to get around Amazon rate limits, the requests are a little spaced out (seeItemSyncJob#sync_all!
).Risks/Tradeoffs
I decided against putting any of these methods on
Item
–to me, it seems cleaner to have an outside object doing the API calls.The rake task calls
#perform_now
because we don't have any sort of messaging queue set up. Given our low traffic, this should be fine for now.TODO
This PR is actually in progress. Here are the things I want to do before this gets merged:
Type of change
How Has This Been Tested?
So far, it hasn't! (Eventually it will be through
spec/jobs/items_sync_job_spec.rb
.)