Skip to content

Commit

Permalink
Merge b662d38 into 694c35d
Browse files Browse the repository at this point in the history
  • Loading branch information
clarakosi committed Nov 2, 2018
2 parents 694c35d + b662d38 commit b850b7c
Showing 1 changed file with 8 additions and 27 deletions.
35 changes: 8 additions & 27 deletions sys/parsoid.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,20 +270,11 @@ class ParsoidService {

saveParsoidResultToFallback(hyper, req, tid, parsoidResp) {
const rp = req.params;
return P.all([
hyper.put({
uri: this.getFallbackBucketURI(rp, 'data-parsoid', tid),
headers: parsoidResp.body['data-parsoid'].headers,
body: parsoidResp.body['data-parsoid'].body
}),
hyper.put({
uri: this.getFallbackBucketURI(rp, 'section-offsets', tid),
headers: {
'content-type': 'application/json'
},
body: parsoidResp.body['data-parsoid'].body.sectionOffsets
}),
])
return hyper.put({
uri: this.getFallbackBucketURI(rp, 'data-parsoid', tid),
headers: parsoidResp.body['data-parsoid'].headers,
body: parsoidResp.body['data-parsoid'].body
})
.then(() => hyper.put({
uri: this.getFallbackBucketURI(rp, 'html', tid),
headers: parsoidResp.body.html.headers,
Expand Down Expand Up @@ -408,11 +399,11 @@ class ParsoidService {
tid: etagInfo.tid
});
return this._getContentWithFallback(hyper, sectionsRP,
'section-offsets', sectionsRP.tid)
.then(sectionOffsets => mwUtil.decodeBody(htmlRes).then((content) => {
'data-parsoid', sectionsRP.tid)
.then(dataParsoid => mwUtil.decodeBody(htmlRes).then((content) => {
const body = cheapBodyInnerHTML(content.body);
const chunks = sections.reduce((result, id) => {
const offsets = sectionOffsets.body[id];
const offsets = dataParsoid.body.sectionOffsets[id];
if (!offsets) {
throw new HTTPError({
status: 400,
Expand Down Expand Up @@ -908,16 +899,6 @@ module.exports = (options) => {
default_time_to_live: options.grace_ttl
}
},
{
// TODO: the `-ng` is only here because we have just one cass cluster
// in dev. Remove before deploying to production
uri: '/{domain}/sys/key_rev_value/parsoid.stash.section-offsets-ng',
body: {
valueType: 'json',
version: 3,
default_time_to_live: options.grace_ttl
}
},
{
uri: '/{domain}/sys/parsoid_bucket/'
}
Expand Down

0 comments on commit b850b7c

Please sign in to comment.