Revert "fix(callback): use setImmediate to callback on main thread"

This reverts commit e9a18b5a46.
This commit is contained in:
dunak-debug committed 2021-08-16 21:35:55 +02:00
1 parent ea98463224
commit baa91dab4e
1 file changed
+7 -7
+7 -7
View File
@@ -14,7 +14,7 @@ global.exports(
setImmediate(() => callback(result[0])); setImmediate(() => callback(result[0]));
}) })
.catch((error) => { .catch((error) => {
setImmediate(() => callback(false)); callback(false);
console.log(error); console.log(error);
}); });
} }
@@ -30,10 +30,10 @@ global.exports(
pool pool
.execute(query, parameters) .execute(query, parameters)
.then((result) => { .then((result) => {
setImmediate(() => callback(result[0][0])); callback(result[0][0]);
}) })
.catch((error) => { .catch((error) => {
setImmediate(() => callback(false)); callback(false);
console.log(error); console.log(error);
}); });
} }
@@ -49,10 +49,10 @@ global.exports(
pool pool
.execute(query, parameters) .execute(query, parameters)
.then((result) => { .then((result) => {
setImmediate(() => callback(Object.values(result[0][0])[0])); callback(Object.values(result[0][0])[0]);
}) })
.catch((error) => { .catch((error) => {
setImmediate(() => callback(false)); callback(false);
console.log(error); console.log(error);
}); });
} }
@@ -68,10 +68,10 @@ global.exports(
pool pool
.execute(query, parameters) .execute(query, parameters)
.then((result) => { .then((result) => {
setImmediate(() => callback(<OkPacket>result[0])); callback(<OkPacket>result[0]);
}) })
.catch((error) => { .catch((error) => {
setImmediate(() => callback(false)); callback(false);
console.log(error); console.log(error);
}); });
} }