mirror of
https://github.com/nasa/openmct.git
synced 2025-02-21 09:52:04 +00:00
[Search] Infinite cycle check
in indexItems in the generic provider.
This commit is contained in:
parent
f76f6548a5
commit
a2eabc1b08
@ -48,6 +48,7 @@ define(
|
||||
*/
|
||||
function GenericSearchProvider($q, objectService, workerService, ROOTS) {
|
||||
var worker = workerService.run('genericSearchWorker'),
|
||||
indexed = {},
|
||||
pendingQueries = {};
|
||||
// pendingQueries is a dictionary with the key value pairs st
|
||||
// the key is the timestamp and the value is the promise
|
||||
@ -123,8 +124,12 @@ define(
|
||||
// Helper function for getItems(). Indexes the tree.
|
||||
function indexItems(nodes) {
|
||||
nodes.forEach(function (node) {
|
||||
var id = node.getId();
|
||||
|
||||
if (!indexed[id]) {
|
||||
// Index each item with the web worker
|
||||
indexItem(node);
|
||||
indexed[id] = true;
|
||||
|
||||
if (node.hasCapability('composition')) {
|
||||
// This node has children
|
||||
@ -137,6 +142,7 @@ define(
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user