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: process multiple pending actions at once

This commit is contained in:
Steffen Vogel 2018-12-04 00:31:37 +01:00
parent a1dce81361
commit ac1b7070f8

View file

@ -88,14 +88,16 @@ void Api::run()
return;
/* Process pending actions */
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())
return;
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())
return;
s->runPendingActions();
s->runPendingActions();
}
}
}