mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-04-22 11:26:33 -04:00
Improved MongoDB handling.
This commit is contained in:
parent
1845950fdb
commit
89d5e8bbbd
1826
db-good.js
1826
db-good.js
File diff suppressed because it is too large
Load Diff
14
db.js
14
db.js
@ -1511,7 +1511,12 @@ module.exports.CreateDB = function (parent, func) {
|
|||||||
for (var i in docs) {
|
for (var i in docs) {
|
||||||
if (docs[i].links != null) { docs[i] = common.unEscapeLinksFieldName(docs[i]); }
|
if (docs[i].links != null) { docs[i] = common.unEscapeLinksFieldName(docs[i]); }
|
||||||
const id = docs[i]._id;
|
const id = docs[i]._id;
|
||||||
if (obj.filePendingGets[id] != null) { for (var j in obj.filePendingGets[id]) { obj.filePendingGets[id][j](err, performTypedRecordDecrypt([docs[i]])); } delete obj.filePendingGets[id]; }
|
if (obj.filePendingGets[id] != null) {
|
||||||
|
for (var j in obj.filePendingGets[id]) {
|
||||||
|
if (typeof obj.filePendingGets[id][j] == 'function') { obj.filePendingGets[id][j](err, performTypedRecordDecrypt([docs[i]])); }
|
||||||
|
}
|
||||||
|
delete obj.filePendingGets[id];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1533,7 +1538,7 @@ module.exports.CreateDB = function (parent, func) {
|
|||||||
// Send out callbacks
|
// Send out callbacks
|
||||||
for (var i in obj.filePendingRemoves) {
|
for (var i in obj.filePendingRemoves) {
|
||||||
for (var j in obj.filePendingRemoves[i]) {
|
for (var j in obj.filePendingRemoves[i]) {
|
||||||
obj.filePendingRemoves[i][j](err);
|
if (typeof obj.filePendingRemoves[i][j] == 'function') { obj.filePendingRemoves[i][j](err); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1550,7 +1555,10 @@ module.exports.CreateDB = function (parent, func) {
|
|||||||
// MongoDB pending bulk write operation, perform fast bulk document replacement.
|
// MongoDB pending bulk write operation, perform fast bulk document replacement.
|
||||||
function fileBulkWriteCompleted() {
|
function fileBulkWriteCompleted() {
|
||||||
// Callbacks
|
// Callbacks
|
||||||
if (obj.filePendingCbs != null) { for (var i in obj.filePendingCbs) { obj.filePendingCbs[i](); } obj.filePendingCbs = null; }
|
if (obj.filePendingCbs != null) {
|
||||||
|
for (var i in obj.filePendingCbs) { if (typeof obj.filePendingCbs[i] == 'function') { obj.filePendingCbs[i](); } }
|
||||||
|
obj.filePendingCbs = null;
|
||||||
|
}
|
||||||
if (obj.filePendingSets != null) {
|
if (obj.filePendingSets != null) {
|
||||||
// Perform pending operations
|
// Perform pending operations
|
||||||
var ops = [];
|
var ops = [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user