1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

api: fixed busy-polling of worker

This commit is contained in:
Steffen Vogel 2020-10-10 22:46:42 +02:00
parent 770e9c2f2c
commit 29f3b23eb3

View file

@ -88,16 +88,14 @@ void Api::worker()
{
logger->info("Started worker");
while (running) {
/* Process pending requests */
while (!pending.empty()) {
Session *s = pending.pop();
if (s) {
/* Check that the session is still alive */
auto it = std::find(sessions.begin(), sessions.end(), s);
if (it != sessions.end())
s->execute();
}
/* Process pending requests */
while (!pending.empty() && running) {
Session *s = pending.pop();
if (s) {
/* Check that the session is still alive */
auto it = std::find(sessions.begin(), sessions.end(), s);
if (it != sessions.end())
s->execute();
}
}