Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fetchDailyDetail (URLs) {
- return URLs.reduce((promise, url) => {
- return promise.then(() => delay(1 * 1000).then(() => {
- return request(URL_PERFIX + url + URL_SURFIX).then(data => {
- // save data
- })
- })).then(() => 'done')
- }, Promise.resolve());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement