-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BEMINFO-1380 Implement queue for link overriding #41
Conversation
* 3. Последовательно выполняем переопределение ссылок для каждой порции записей | ||
* 3.1 Внутри порции переопредление ссылок для записей происходит параллельно | ||
* 3.2 Для каждой записи страницы выбираем связанную с ней запись документа | ||
* 3.3 Еслитаковая присутствует, то скармливаем ее content в переопределятор |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Еслитаковая
Судя по настройкам jscs файл с переопределением ссылок не должен был быть закоммичен - |
} | ||
|
||
return false; | ||
}, { gte: target.KEY.NODE_PREFIX, lt: target.KEY.PEOPLE_PREFIX, fillCache: true }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
;
в конце
а так вроде ок. |
return getDocumentRecordsFromDb(target, changedLibVersions).then(function (records) { | ||
logger.debug(util.format('Document records count: %s', records.length), module); | ||
var portionSize = 100, | ||
portions = utility.separateArrayOnChunks(records, portionSize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Может не в тему PR, но почему у нас в группе так не любят lodash
- https://lodash.com/docs#chunk
Кажется, что код создания очереди return getDocumentRecordsFromDb(target, changedLibVersions).then(function (records) {
logger.debug(util.format('Document records count: %s', records.length), module);
var portionSize = 100,
portions = utility.separateArrayOnChunks(records, portionSize);
logger.debug(util.format('Document records were divided into %s portions', portions.length), module);
return portions.reduce(function (prev, item, index) {
prev = prev.then(function () {
...
return prev;
}, vow.resolve());
}); одинаковый для function overrideLinksInDocuments (target, urlsHash, languages, changedLibVersions) { и function overrideLinksInBlocks(target, urlsHash, languages, changedLibVersions) { Может его как-то инкапсулировать в отдельный метод ? |
А вообще очередь прикольно сделалась =) |
Да, я согласен. Но здесь особого профита не получится. |
BEMINFO-1380 Implement queue for link overriding
@@ -311,7 +312,21 @@ function overrideLinks(content, node, urlHash, lang, doc) { | |||
return content; | |||
} | |||
|
|||
/** | |||
* Creates url hash for resolve links |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to resolve
@gela-d
@SwinX
Please review it