mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 20:42:56 +02:00
make sure server/mixers are first in FIFO
This commit is contained in:
parent
8f061bcf2e
commit
e21c1cb67c
1 changed files with 16 additions and 3 deletions
|
@ -1744,9 +1744,22 @@ void DomainServer::addStaticAssignmentsToQueue() {
|
||||||
|
|
||||||
// if the domain-server has just restarted,
|
// if the domain-server has just restarted,
|
||||||
// check if there are static assignments that we need to throw into the assignment queue
|
// check if there are static assignments that we need to throw into the assignment queue
|
||||||
QHash<QUuid, SharedAssignmentPointer> staticHashCopy = _allAssignments;
|
auto sharedAssignments = _allAssignments.values();
|
||||||
QHash<QUuid, SharedAssignmentPointer>::iterator staticAssignment = staticHashCopy.begin();
|
|
||||||
while (staticAssignment != staticHashCopy.end()) {
|
// sort the assignments to put the server/mixer assignments first
|
||||||
|
qSort(sharedAssignments.begin(), sharedAssignments.end(), [](SharedAssignmentPointer a, SharedAssignmentPointer b){
|
||||||
|
if (a->getType() == b->getType()) {
|
||||||
|
return true;
|
||||||
|
} else if (a->getType() != Assignment::AgentType && b->getType() != Assignment::AgentType) {
|
||||||
|
return a->getType() < b->getType();
|
||||||
|
} else {
|
||||||
|
return a->getType() != Assignment::AgentType;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
auto staticAssignment = sharedAssignments.begin();
|
||||||
|
|
||||||
|
while (staticAssignment != sharedAssignments.end()) {
|
||||||
// add any of the un-matched static assignments to the queue
|
// add any of the un-matched static assignments to the queue
|
||||||
|
|
||||||
// enumerate the nodes and check if there is one with an attached assignment with matching UUID
|
// enumerate the nodes and check if there is one with an attached assignment with matching UUID
|
||||||
|
|
Loading…
Reference in a new issue