I have a function that returns a promise.
this.getDataFromMainDB()
.then()
.catch();
This function gets more than 300.000 records from the main DB and stores it on the microservice DB, so that it can do its job.
It uses an AsyncGenerator (with 1.000 limit), KnexJS to connect to SQL Server.
Now, timeouts occur during this query and it stops.
I thought of using another function on that catch that would take the last ID recorded in the microservice DB and restart the query from than on.
My question is:
OR