Fixed excessively high CPU load

This commit is contained in:
Pax1601 2023-12-13 22:06:51 +01:00
parent a52e7e7b1a
commit 378dbfc085
4 changed files with 4 additions and 2 deletions

1
.gitignore vendored
View File

@ -19,3 +19,4 @@ hgt
/client/public/databases/units/old
/client/plugins/databasemanager/index.js
*.aps

View File

@ -36,6 +36,7 @@ Source: "..\scripts\OlympusCommand.lua"; DestDir: "{app}\Mods\Services\Olympus\S
Source: "..\scripts\unitPayloads.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion
Source: "..\scripts\templates.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion
Source: "..\scripts\mist.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion
Source: "..\scripts\mods.lua"; DestDir: "{app}\Mods\Services\Olympus\Scripts"; Flags: ignoreversion
Source: "..\mod\*"; DestDir: "{app}\Mods\Services\Olympus"; Flags: ignoreversion recursesubdirs;

View File

@ -88,7 +88,7 @@ extern "C" DllExport int coreFrame(lua_State* L)
frameCounter++;
const std::chrono::duration<double> executionDuration = std::chrono::system_clock::now() - lastExecution;
if (executionDuration.count() > FRAMERATE_TIME_INTERVAL) {
if (executionDuration.count() > (20 * FRAMERATE_TIME_INTERVAL)) {
if (executionDuration.count() > 0) {
scheduler->setFrameRate(frameCounter / executionDuration.count());
frameCounter = 0;

View File

@ -330,7 +330,7 @@ void Server::task()
.then([&listener]() {log("RESTServer starting to listen"); })
.wait();
while (runListener);
while (runListener) { Sleep(1000); };
listener.close()
.then([&listener]() {log("RESTServer stopping connections"); })