applyGlobalMaxTimeMS.js 455 B

123456789101112131415
  1. 'use strict';
  2. const utils = require('../../utils');
  3. module.exports = function applyGlobalMaxTimeMS(options, model) {
  4. if (utils.hasUserDefinedProperty(options, 'maxTimeMS')) {
  5. return;
  6. }
  7. if (utils.hasUserDefinedProperty(model.db.options, 'maxTimeMS')) {
  8. options.maxTimeMS = model.db.options.maxTimeMS;
  9. } else if (utils.hasUserDefinedProperty(model.base.options, 'maxTimeMS')) {
  10. options.maxTimeMS = model.base.options.maxTimeMS;
  11. }
  12. };