Skip to content

Instantly share code, notes, and snippets.

@pandres95
Created November 23, 2018 06:02
Show Gist options
  • Save pandres95/bc9395af42b87dd1be6cb4ccbe02160f to your computer and use it in GitHub Desktop.
Save pandres95/bc9395af42b87dd1be6cb4ccbe02160f to your computer and use it in GitHub Desktop.
const BreakException = {};
try {
for (let e of postsAffiliate) {
if (e.type === 'video') {
if (parseInt(e.object_id) === parseInt(lastId)) {
// Es igual. Rompe la secuencia.
continue;
} else {
const searchDb = await mysql.searchPostOnPosts(e.object_id);
if (searchDb) {
const searchPostAffiliate =
await mysql.searchPostAffiliateOnDB(e.object_id);
if (!searchPostAffiliate) {
await mysql.insertNewPostAffiliate(searchDb[0]);
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment