I need to import 100,000 products from one database to another using the results from a RESTful API. But I can only do this overnight. So if I can't get the job done in one day, I need to spread it out over multiple nights.
I have an endpoint that will return a list of ids for a given set of criteria. I have an endpoint that will return the full product information for one or more products (I can specify n
number of ids to return full objects of).
I don't want to get 100,000 ids and just start iterating with a for-loop. That seems like it could break unexpectedly and then I wouldn't know where I ended. I need some way to break it a part and save my progress. Does anyone have any experience with this sort of thing?
The software I'm using: Flask
, SQLAlchemy
, and Huey
(for scheduling).