function raceTo(promise, ms, msg) {
  let timeout;

  return Promise.race([
    promise,
    new Promise((resolve) => {
      timeout = setTimeout(() => resolve(PROMISE_TIMEOUT), ms);
    }),
  ]).then((res) => {
    if (res === PROMISE_TIMEOUT) logger.info(msg, { timeout: ms });
    if (timeout) clearTimeout(timeout);

    return res;
  }).catch((err) => {
    if (timeout) clearTimeout(timeout);

    return Promise.reject(err);
  });
}
Creates a promise that resolves at the specified number of ms.

@param ms
@returns {Promise}