How to use the long-timeout.clearTimeout function in long-timeout

To help you get started, we’ve selected a few long-timeout examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github feathersjs / feathers / packages / authentication / lib / socket / handler.js View on Github external
}

        const promise = service.remove(accessToken, { authenticated: true }).then(tokens => {
          debug(`Successfully logged out socket with accessToken`, accessToken);

          app.emit('logout', tokens, {
            provider,
            socket,
            connection
          });

          return tokens;
        });

        // Clear logoutTimer.
        lt.clearTimeout(logoutTimer);

        handleSocketCallback(promise, callback);
      } else if (typeof callback === 'function') {
        return callback(null, {});
      }
    };
github node-schedule / node-schedule / lib / schedule.js View on Github external
function cancelInvocation(invocation) {
  var idx = invocations.indexOf(invocation);
  if (idx > -1) {
    invocations.splice(idx, 1);
    if (invocation.timerID !== null) {
      lt.clearTimeout(invocation.timerID);
    }

    if (currentInvocation === invocation) {
      currentInvocation = null;
    }

    invocation.job.emit('canceled', invocation.fireDate);
    prepareNextInvocation();
  }
}
github AdamPflug / express-brute / lib / MemoryStore.js View on Github external
MemoryStore.prototype.reset = function (key, callback) {
	key = this.options.prefix+key;
	
	if (this.data[key] && this.data[key].timeout) {
		longTimeout.clearTimeout(this.data[key].timeout);
	}
	delete this.data[key];
	typeof callback == 'function' && callback(null);
};
MemoryStore.defaults = {
github sx1989827 / DOClever / node_modules / node-schedule / lib / schedule.js View on Github external
function prepareNextInvocation() {
  if (invocations.length > 0 && currentInvocation !== invocations[0]) {
    if (currentInvocation !== null) {
      lt.clearTimeout(currentInvocation.timerID);
      currentInvocation.timerID = null;
      currentInvocation = null;
    }

    currentInvocation = invocations[0];

    var job = currentInvocation.job;
    var cinv = currentInvocation;
    currentInvocation.timerID = runOnDate(currentInvocation.fireDate, function() {
      currentInvocationFinished();

      if (job.callback) {
        job.callback();
      }

      if (cinv.recurrenceRule.recurs || cinv.recurrenceRule._endDate === null) {
github Picolab / pico-engine / packages / pico-engine-core / src / Scheduler.js View on Github external
var clearCurrTimeout = function () {
    if (currTimeout && !conf.is_test_mode) {
      lt.clearTimeout(currTimeout)
    }
    currTimeout = null
  }
github ILIAS-eLearning / ILIAS / Modules / Chatroom / chat / node_modules / node-schedule / lib / schedule.js View on Github external
function prepareNextInvocation() {
  if (invocations.length > 0 && currentInvocation !== invocations[0]) {
    if (currentInvocation !== null) {
      lt.clearTimeout(currentInvocation.timerID);
      currentInvocation.timerID = null;
      currentInvocation = null;
    }

    currentInvocation = invocations[0];

    var job = currentInvocation.job;
    var cinv = currentInvocation;
    currentInvocation.timerID = runOnDate(currentInvocation.fireDate, function() {
      currentInvocationFinished();

      if (job.callback) {
        job.callback();
      }

      if (cinv.recurrenceRule.recurs || cinv.recurrenceRule._endDate === null) {
github rstacruz / cron-scheduler / index.js View on Github external
function schedule () {
    var future = next()
    var delta = Math.max(future.diff(moment()), 1000)

    debug(name + ': next run in ' + ms(delta) +
      ' at ' + future.format('llll Z'))

    if (timer) lt.clearTimeout(timer)
    timer = lt.setTimeout(run, delta)
  }
github node-schedule / node-schedule / src / schedule.js View on Github external
function prepareNextInvocation() {
  if (invocations.length > 0 && currentInvocation !== invocations[0]) {
    if (currentInvocation !== null) {
      lt.clearTimeout(currentInvocation.timerID);
      currentInvocation.timerID = null;
      currentInvocation = null;
    }

    currentInvocation = invocations[0];

    var job = currentInvocation.job;
    var cinv = currentInvocation;
    currentInvocation.timerID = runOnDate(currentInvocation.fireDate, function() {
      currentInvocationFinished();

      if (cinv.recurrenceRule.recurs || cinv.recurrenceRule._endDate === null) {
        var inv = scheduleNextRecurrence(cinv.recurrenceRule, cinv.job, cinv.fireDate);
        if (inv !== null) {
          inv.job.trackInvocation(inv);
        }
github node-schedule / node-schedule / lib / schedule.js View on Github external
function prepareNextInvocation() {
  if (invocations.length > 0 && currentInvocation !== invocations[0]) {
    if (currentInvocation !== null) {
      lt.clearTimeout(currentInvocation.timerID);
      currentInvocation.timerID = null;
      currentInvocation = null;
    }

    currentInvocation = invocations[0];

    var job = currentInvocation.job;
    var cinv = currentInvocation;
    currentInvocation.timerID = runOnDate(currentInvocation.fireDate, function() {
      currentInvocationFinished();

      if (job.callback) {
        job.callback();
      }

      if (cinv.recurrenceRule.recurs || cinv.recurrenceRule._endDate === null) {

long-timeout

Long timeout makes it possible to have a timeout or interval that is longer than 24.8 days (2^31-1 milliseconds).

MIT
Latest version published 8 years ago

Package Health Score

67 / 100
Full package analysis

Similar packages