forked from svrjs/svrjs
Replace ES5-style functions in code for sending data to a statistics server with ES6-style functions
This commit is contained in:
parent
f403053c44
commit
686ec4924e
1 changed files with 4 additions and 4 deletions
|
@ -1008,13 +1008,13 @@ function listeningMessage() {
|
|||
"Content-Length": Buffer.byteLength(statisticsToSend),
|
||||
},
|
||||
},
|
||||
function (res) {
|
||||
(res) => {
|
||||
const statusCode = res.statusCode;
|
||||
let data = "";
|
||||
res.on("data", function (chunk) {
|
||||
res.on("data", (chunk) => {
|
||||
data += chunk.toString();
|
||||
});
|
||||
res.on("end", function () {
|
||||
res.on("end", () => {
|
||||
try {
|
||||
let parsedJson = {};
|
||||
try {
|
||||
|
@ -1036,7 +1036,7 @@ function listeningMessage() {
|
|||
});
|
||||
},
|
||||
);
|
||||
statisticsRequest.on("error", function (err) {
|
||||
statisticsRequest.on("error", (err) => {
|
||||
serverconsole.locwarnmessage(
|
||||
"There was a problem, when sending data to statistics server! Reason: " +
|
||||
err.message,
|
||||
|
|
Reference in a new issue