I am trying to implement following scenario. 1. Query Db after every 20 mins. 2. Send an api request for every account in db. Say there are twenty records, send 20 different requests to third party apis. 3. Requests have to be sent with the delay of 5 seconds. (Api limit constraint) 4. Repeat.My solution: setinterval for db 20 mins. And then loop through the records and setinterval of 5 second for each request.Problem: outer setinterval creates more setinterval instances everytime it executes.Also if there is any better approach other than setinterval please let me know. TIA
Submitted September 04, 2020 at 01:22PM by dsmedium
No comments:
Post a Comment