public void run() {
        this.invoking = true;
        try {
            onTrigger();
        } catch (final Throwable t) {
            LOG.error("Run timer failed.", t);
        }
        boolean invokeDestroyed = false;
        this.lock.lock();
        try {
            this.invoking = false;
            if (this.stopped) {
                this.running = false;
                invokeDestroyed = this.destroyed;
            } else {
                this.timeout = null;
                schedule();
            }
        } finally {
            this.lock.unlock();
        }
        if (invokeDestroyed) {
            onDestroy();
        }
    }
Adjust timeoutMs before every scheduling.

@param timeoutMs timeout millis
@return timeout millis
jraft-core/src/main/java/com/alipay/sofa/jraft/util/RepeatedTimer.java