mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-04 00:36:14 +00:00
Possible fix for event handler timeouts
This commit is contained in:
parent
ccdc5dae17
commit
98c7fea139
@ -149,8 +149,7 @@ void TConsole::Command_Help(const std::string&) {
|
|||||||
kick <name> [reason] kicks specified player with an optional reason
|
kick <name> [reason] kicks specified player with an optional reason
|
||||||
list lists all players and info about them
|
list lists all players and info about them
|
||||||
say <message> sends the message to all players in chat
|
say <message> sends the message to all players in chat
|
||||||
lua [state id] switches to lua, optionally into a specific state id's lua
|
lua [state id] switches to lua, optionally into a specific state id's lua)";
|
||||||
)";
|
|
||||||
Application::Console().WriteRaw("BeamMP-Server Console: " + std::string(sHelpString));
|
Application::Console().WriteRaw("BeamMP-Server Console: " + std::string(sHelpString));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,8 +61,11 @@ void TLuaEngine::operator()() {
|
|||||||
while (!Res->Ready) {
|
while (!Res->Ready) {
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||||
Waited++;
|
Waited++;
|
||||||
if (Waited > 1000) {
|
if (Waited > 250) {
|
||||||
beammp_lua_error(Res->Function + " in " + Res->StateId + " took >1s to respond, not printing possible errors");
|
// FIXME: This should *eventually* timeout.
|
||||||
|
// beammp_lua_error(Res->Function + " in " + Res->StateId + " took >1s to respond, not printing possible errors");
|
||||||
|
std::unique_lock Lock(mResultsToCheckMutex);
|
||||||
|
mResultsToCheck.push(Res);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user