@dhyasama/totem-models 9.85.0 → 9.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -108,13 +108,13 @@ module.exports = function(mongoose, config) {
|
|
|
108
108
|
if (!mongoose.Types.ObjectId.isValid(customerId)) { return cb(new Error('customerId is not a valid ObjectId'), null); }
|
|
109
109
|
|
|
110
110
|
const query = self.find({
|
|
111
|
-
customer: customerId
|
|
111
|
+
customer: customerId,
|
|
112
|
+
$or: [
|
|
113
|
+
{ processed: true },
|
|
114
|
+
{ numberOfFailedAttempts: { $lt: MAX_PROCESSING_ATTEMPTS } }
|
|
115
|
+
]
|
|
112
116
|
});
|
|
113
117
|
|
|
114
|
-
// Processed or done trying
|
|
115
|
-
query['$or'].push({ processed: true });
|
|
116
|
-
query['$or'].push({ numberOfFailedAttempts: { $lt: MAX_PROCESSING_ATTEMPTS } });
|
|
117
|
-
|
|
118
118
|
query.exec(cb);
|
|
119
119
|
|
|
120
120
|
};
|