I need to adapt my server to do longer reports and I came across this nice old blog post that was made in 2015.
However, I'm not sure if I applied the directions correctly, or if the key names are correct. I am declaring my config and passing it in as follows. However, I'm not sure if "tasks"
as listed in the article should be "scripts"
in mine, for instance, or what the meaning of "dedicated-process"
might be in contrast with "http-server"
.
I think this config is wrong. can anyone help me out?
let config = {
extensions: {
scripts: {
timeout: 600000,
strategy: 'http-server',
allowedModules: '*',
},
},
httpPort: process.env.PORT || 5488,
store: {
provider: 'fs',
},
blobStorage: {
provider: 'fs',
},
allowLocalFilesAccess: true,
templatingEngines: {
timeout: 600000,
strategy: 'http-server',
},
chrome: {
timeout: 600000,
},
tasks: {
timeout: 600000,
strategy: 'dedicated-process',
forkOptions: {
execArgv: ['--max-old-space-size=4096'],
},
},
phantom: {
timeout: 600000,
},
express: {
renderTimeout: 600000,
},
}
async initJsr() {
let jsr = require('jsreport')(config);
return jsr
.init()
.then(() => {
// running
console.log('jsreport instance started successfully');
console.log('using extensions:', config.extensions);
})
.catch(e => {
// error during startup
console.error(e.stack);
process.exit(1);
});
}