Created
May 31, 2018 09:48
-
-
Save kharandziuk/647b5b09b12a9bb2c24b1ef9c1489302 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function grab(offset = 0, rows = 1000) { | |
| while(true) { | |
| const items = await getAPI(offset, rows) | |
| if (_.isEmpty(items)) { | |
| break | |
| } | |
| await insertDB(items) | |
| offset = offset + rows | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment