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:
parent
a1dce81361
commit
ac1b7070f8
1 changed files with 9 additions and 7 deletions
16
lib/api.cpp
16
lib/api.cpp
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue