mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 14:38:50 +00:00
fix(callback): use process._tickCallback() fix (process.nextTick())
- this fixes whole issue with slow queries - https://github.com/alcoholiclobster/fivem-mongodb/blob/400ac6615a334d43531a7a1824f2e8b540246fe2/index.js#L105 - setImmediate will just make performance worse - now it also works in coroutine if yielded - also i´m not sure why tickCallback helps, if somebody know i would be glad to know :D - process.nextTick() is issue maybe, it works only for natives and not node functions - process.nextTick isn't firing until the socket timeout callback fires - discord conversation about it https://discord.com/channels/192358910387159041/433008322732490778/479523175869317130
This commit is contained in:
1 file changed
+4
@@ -17,6 +17,7 @@ global.exports(
|
||||
callback(false);
|
||||
console.log(error);
|
||||
});
|
||||
(<any>process)._tickCallback();
|
||||
}
|
||||
);
|
||||
|
||||
@@ -36,6 +37,7 @@ global.exports(
|
||||
callback(false);
|
||||
console.log(error);
|
||||
});
|
||||
(<any>process)._tickCallback();
|
||||
}
|
||||
);
|
||||
|
||||
@@ -55,6 +57,7 @@ global.exports(
|
||||
callback(false);
|
||||
console.log(error);
|
||||
});
|
||||
(<any>process)._tickCallback();
|
||||
}
|
||||
);
|
||||
|
||||
@@ -74,5 +77,6 @@ global.exports(
|
||||
callback(false);
|
||||
console.log(error);
|
||||
});
|
||||
(<any>process)._tickCallback();
|
||||
}
|
||||
);
|
||||
Reference in new issue
Block a user