async register() {
    const promises = this.loadbalancers.map((loadbalancer) => {
      // eslint-disable-next-line max-len
      const uri = `${loadbalancer}/register/${this.host}/${this.cpus}/${this.rooms}/${this.version}`;
      const requestOptions = {
        method: 'put',
        url: uri,
        headers: {'X-API-Key': this.lbKey},
      };
      return this.circuitBreaker.callService(requestOptions);
      // return axios.put(uri).then(function(response) {
      //   return response.status;
      // });
    });

    try {
      await Promise.all(promises);
      // debug(res);
    } catch (error) {
      if (error.response) {
        console.error('RES', error.response.status);
      } else if (error.request) {
        // eslint-disable-next-line max-len
        console.error(`Request failure: Loadbalancer at ${error.request._options.hostname}:${error.request._options.port}`);
      } else {
        console.error('Error', error.message);
      }
    }
  }
/**
  * Register or send a heartbeat update to the loadbalancers
  */
Register or send a heartbeat update to the loadbalancers
Register or send a heartbeat update to the loadbalancers
async register() {
    const promises = this.loadbalancers.map((loadbalancer) => {
      const uri = `${loadbalancer}/register/${this.host}/${this.cpus}/${this.rooms}/${this.version}`;
      const requestOptions = {
        method: 'put',
        url: uri,
        headers: {'X-API-Key': this.lbKey},
      };
      return this.circuitBreaker.callService(requestOptions);
    });
    try {
      await Promise.all(promises);
    } catch (error) {
      if (error.response) {
        console.error('RES', error.response.status);
      } else if (error.request) {
        console.error(`Request failure: Loadbalancer at ${error.request._options.hostname}:${error.request._options.port}`);
      } else {
        console.error('Error', error.message);
      }
    }
  }
async register ( ) { const promises = this . loadbalancers . map ( ( loadbalancer ) => { const uri = ` ${ loadbalancer } ${ this . host } ${ this . cpus } ${ this . rooms } ${ this . version } ` ; const requestOptions = { method : 'put' , url : uri , headers : { 'X-API-Key' : this . lbKey } , } ; return this . circuitBreaker . callService ( requestOptions ) ; } ) ; try { await Promise . all ( promises ) ; } catch ( error ) { if ( error . response ) { console . error ( 'RES' , error . response . status ) ; } else if ( error . request ) { console . error ( ` ${ error . request . _options . hostname } ${ error . request . _options . port } ` ) ; } else { console . error ( 'Error' , error . message ) ; } } }
Register or send a heartbeat update to the loadbalancers
Register or send a heartbeat update to the loadbalancers
// eslint-disable-next-line max-len // return axios.put(uri).then(function(response) { //   return response.status; // }); // debug(res); // eslint-disable-next-line max-len