@nitunity/api-compiler
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -60,15 +60,8 @@ const request = require('./request') | ||
.then((response) => { | ||
let counter = 0 | ||
let interval = setInterval( () => { | ||
if (counter >= response.length) { | ||
clearInterval(interval) | ||
counter = 0 | ||
return | ||
} | ||
let slug = response[counter] | ||
let cnt = 1 | ||
let int = setInterval(() => { | ||
request.categoryPosts(slug, cnt) | ||
response.forEach((slug) => { | ||
let counter = 1 | ||
let interval = setInterval(() => { | ||
request.categoryPosts(slug, counter) | ||
.then((res) => { | ||
if (res.posts.current_page <= res.posts.last_page) { | ||
if (res.posts.data.length > 0) { | ||
params.category = res | ||
@@ -79,4 +72,4 @@ params.posts = res.posts | ||
.then(() => { | ||
console.log('CategoryPosts is compiled') | ||
cnt++ | ||
console.log('У Категорий компилировались посты') | ||
counter++ | ||
}) | ||
@@ -87,4 +80,4 @@ .catch(e => { | ||
} else { | ||
clearInterval(int) | ||
cnt = 1 | ||
clearInterval(interval) | ||
counter = 1 | ||
} | ||
@@ -95,6 +88,4 @@ }) | ||
}) | ||
}, 2000) | ||
counter++ | ||
}, 4000) | ||
}) | ||
}) | ||
@@ -119,3 +110,3 @@ .catch(e => { | ||
.then(() => { | ||
console.log(`Post-${slug} is compiled`) | ||
console.log(`Пост ${slug} скомпилирован`) | ||
}) | ||
@@ -131,3 +122,3 @@ .catch(e => { | ||
counter++ | ||
}, 2000) | ||
}, 1000) | ||
}) | ||
@@ -143,3 +134,3 @@ .catch(e => { | ||
.then(() => { | ||
console.log('Tags compiled') | ||
console.log('Страница тегов скомпилирован') | ||
}) | ||
@@ -156,30 +147,24 @@ .catch(e => { | ||
.then((response) => { | ||
let counter = 0 | ||
let interval = setInterval(async () => { | ||
if (counter >= response.length) { | ||
clearInterval(interval) | ||
return | ||
} | ||
let slug = response[counter] | ||
let cnt = 1; | ||
request.tagPosts(slug, cnt) | ||
.then((res) => { | ||
params.tag = res | ||
params.posts = res.posts | ||
params.paginator = new paginator(res.posts, process.env.APP_URL + '/tags') | ||
engine.tagPosts(config, params, slug, counter) | ||
.then(() => { | ||
console.log('TagPosts is compiled') | ||
cnt++ | ||
}) | ||
.catch(e => { | ||
console.log(e.message) | ||
}) | ||
}) | ||
.catch(e => { | ||
console.log(e.message) | ||
}) | ||
counter++ | ||
}, 2000) | ||
response.forEach((slug) => { | ||
let counter = 1; | ||
request.tagPosts(slug, counter) | ||
.then((res) => { | ||
if (res.posts.data.length > 0) { | ||
params.tag = res | ||
params.posts = res.posts | ||
params.paginator = new paginator(res.posts, process.env.APP_URL + '/tags') | ||
engine.tagPosts(config, params, slug, counter) | ||
.then(() => { | ||
console.log('У Тегов посты скомпилированы') | ||
counter++ | ||
}) | ||
.catch(e => { | ||
console.log(e.message) | ||
}) | ||
} | ||
}) | ||
.catch(e => { | ||
console.log(e.message) | ||
}) | ||
}) | ||
}) | ||
@@ -186,0 +171,0 @@ .catch(e => { |
{ | ||
"name": "@nitunity/api-compiler", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "This package is API for compiling HTML templates using Nunjucks template engine", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15314
16
403