Skip to content
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

Merged
merged 4 commits into from
Aug 3, 2015
Merged

Conversation

tormozz48
Copy link
Member

@gela-d
@SwinX

Please review it

* 3. Последовательно выполняем переопределение ссылок для каждой порции записей
* 3.1 Внутри порции переопредление ссылок для записей происходит параллельно
* 3.2 Для каждой записи страницы выбираем связанную с ней запись документа
* 3.3 Еслитаковая присутствует, то скармливаем ее content в переопределятор
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Еслитаковая

@gela-d
Copy link

gela-d commented Aug 3, 2015

Судя по настройкам jscs файл с переопределением ссылок не должен был быть закоммичен - 73 code style errors found.

}

return false;
}, { gte: target.KEY.NODE_PREFIX, lt: target.KEY.PEOPLE_PREFIX, fillCache: true })
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

; в конце

@gela-d
Copy link

gela-d commented Aug 3, 2015

а так вроде ок.

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);
Copy link

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

@SwinX
Copy link

SwinX commented Aug 3, 2015

Кажется, что код создания очереди

    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) {

Может его как-то инкапсулировать в отдельный метод ?

@SwinX
Copy link

SwinX commented Aug 3, 2015

А вообще очередь прикольно сделалась =)
Отписал замечания.

@tormozz48
Copy link
Member Author

Может его как-то инкапсулировать в отдельный метод ?

Да, я согласен. Но здесь особого профита не получится.

tormozz48 added a commit that referenced this pull request Aug 3, 2015
BEMINFO-1380 Implement queue for link overriding
@tormozz48 tormozz48 merged commit 1de7d9e into master Aug 3, 2015
@tormozz48 tormozz48 deleted the BEMINFO-1380 branch August 3, 2015 11:16
@@ -311,7 +312,21 @@ function overrideLinks(content, node, urlHash, lang, doc) {
return content;
}

/**
* Creates url hash for resolve links

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to resolve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants