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( await Promise.all(
[].map.call(styleTags, async style => { [].map.call(styleTags, async style => {
style.type = 'text/css'; 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, testHTML,
flow( flow(
partial( partial(vinyl.transformHeadTailAndContents, source => {
vinyl.transformHeadTailAndContents, const div = document.createElement('div');
source => { div.innerHTML = source;
const div = document.createElement('div'); return div.innerHTML;
div.innerHTML = source; }),
return div.innerHTML;
}
),
partial(vinyl.compileHeadTail, '') partial(vinyl.compileHeadTail, '')
) )
], ],

View File

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