fix(client): tune a worker executor

This commit is contained in:
Valeriy S
2018-12-10 18:06:05 +03:00
committed by Stuart Taylor
parent 7df4d06056
commit cc0b504224
2 changed files with 9 additions and 10 deletions

View File

@ -97,7 +97,7 @@ async function transformSASS(element) {
await Promise.all(
[].map.call(styleTags, async style => {
style.type = 'text/css';
style.innerHTML = await sassWorker.execute(style.innerHTML, 2000);
style.innerHTML = await sassWorker.execute(style.innerHTML, 5000);
})
);
}
@ -122,14 +122,11 @@ export const composeHTML = cond([
[
testHTML,
flow(
partial(
vinyl.transformHeadTailAndContents,
source => {
const div = document.createElement('div');
div.innerHTML = source;
return div.innerHTML;
}
),
partial(vinyl.transformHeadTailAndContents, source => {
const div = document.createElement('div');
div.innerHTML = source;
return div.innerHTML;
}),
partial(vinyl.compileHeadTail, '')
)
],

View File

@ -1,3 +1,5 @@
import { homeLocation } from '../../../../config/env.json';
export default class WorkerExecutor {
constructor(workerName) {
this.workerName = workerName;
@ -11,7 +13,7 @@ export default class WorkerExecutor {
getWorker() {
if (this.worker === null) {
this.worker = new Worker(`js/${this.workerName}.js`);
this.worker = new Worker(`${homeLocation}/js/${this.workerName}.js`);
}
return this.worker;