loop handle and then
const loop = gistList.map((_gistObject) => {
return new Promise(async (resolve) => {
const gistId = _gistObject.id;
const gistObject = await getGistObject(gistId);
const csonFile = await createCsonFile(gistObject);
await saveCsonFileToDisk(gistId, csonFile);
resolve();
});
});
Promise.all(loop).then(() => {
logSuccess('Job finish with successfully.');
});
const gistList = await gistClient.getAll({ filterBy: [{ userName: username }] });
for(let _gistObject of gistList) {
const gistId = _gistObject.id;
const gistObject = await getGistObject(gistId);
const csonFile = await createCsonFile(gistObject);
await saveCsonFileToDisk(gistId, csonFile);
}
logSuccess('Job finish with successfully.');