function execute() {
  const date = new Date();
  date.setMinutes(date.getMinutes() - conf.minRoomDeactivationAge);
  return dbRoom.findAll(
    { where:
      {
        active: true,
        createdAt: {
          [Op.lt]: date,
        },
      },
  })
  .then((dbRes) => {
    const promises = dbRes.map((room) => checkAndDeactivateRoom(room));
    return Promise.all(promises);
  });
} // execute
/**
 * Execute the call to deactivate rooms with no recent activity
 *
 * @returns {Promise} - Promise that rooms were deactivated
 */
Execute the call to deactivate rooms with no recent activity
@returns {Promise} - Promise that rooms were deactivated
Execute the call to deactivate rooms with no recent activity @returns { Promise } - Promise that rooms were deactivated
function execute() {
  const date = new Date();
  date.setMinutes(date.getMinutes() - conf.minRoomDeactivationAge);
  return dbRoom.findAll(
    { where:
      {
        active: true,
        createdAt: {
          [Op.lt]: date,
        },
      },
  })
  .then((dbRes) => {
    const promises = dbRes.map((room) => checkAndDeactivateRoom(room));
    return Promise.all(promises);
  });
} 
function execute ( ) { const date = new Date ( ) ; date . setMinutes ( date . getMinutes ( ) - conf . minRoomDeactivationAge ) ; return dbRoom . findAll ( { where : { active : true , createdAt : { [ Op . lt ] : date , } , } , } ) . then ( ( dbRes ) => { const promises = dbRes . map ( ( room ) => checkAndDeactivateRoom ( room ) ) ; return Promise . all ( promises ) ; } ) ; }
Execute the call to deactivate rooms with no recent activity
 @returns {Promise} - Promise that rooms were deactivated
Execute the call to deactivate rooms with no recent activity @returns { Promise } - Promise that rooms were deactivated
// execute