Closed medjedovicm closed 1 year ago
fixed the issue of server freeze.
In the JS STP running HTTP request makes server freeze.
So basically node child_process tries to run request to initial parent node process. There is only one clue in the log, request is being made by:
editor.worker.js
GET /editor.worker.js HTTP/1.1" 200 201849
Steps to reproduce:
- We need
axios
available In:/api/src/controllers/internal/createJSProgram.ts
- Code
axios('http://localhost:5000/SASjsApi/info').then(res => console.log(res.data))
adding axios to requiredModules string would not work as it is a third-party library. You need to provide bundled code if you want to use axios. Rather, I would suggest to use node's built-in module like 'httpor
https`
here's the reference for using http
module
const http = require('http');
http.get('http://localhost:5000/SASjsApi/info', res => {
let data = [];
const headerDate = res.headers && res.headers.date ? res.headers.date : 'no response date';
console.log('Status Code:', res.statusCode);
console.log('Date in Response header:', headerDate);
res.on('data', chunk => {
data.push(chunk);
});
res.on('end', () => {
console.log('Response ended: ');
const responseData = JSON.parse(Buffer.concat(data).toString());
console.log('Response Data: ', responseData);
});
}).on('error', err => {
console.log('Error: ', err.message);
});
:tada: This issue has been resolved in version 0.28.2 :tada:
The release is available on:
v0.28.2
Your semantic-release bot :package::rocket:
In the JS STP running HTTP request makes server freeze.
So basically node child_process tries to run request to initial parent node process. There is only one clue in the log, request is being made by:
editor.worker.js
Steps to reproduce:
axios
available In:/api/src/controllers/internal/createJSProgram.ts