How to use schedule - 6 common examples

To help you get started, we’ve selected a few schedule 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 simonprickett / bartnodeapi / server.js View on Github external
if (typeof(Number.prototype.toRad) === 'undefined') {
  Number.prototype.toRad = function() {
    return this * (Math.PI / 180);
  }
}

// Prime the station list on startup and read periodically
loadStationList();
every('24h').do(function() {
	loadStationList();
});

// Prime the elevator status on startup and read periodically
loadElevatorStatus();
every('15m').do(function() {
	loadElevatorStatus();
});

app.use(cors());
app.use('/', router);
app.listen(port);
console.log('BART API Server listening on port ' + port);
github simonprickett / bartnodeapi / server.js View on Github external
router.route(apiContext + '/elevatorStatus').get(
	function(request, response) {
		response.jsonp(infoCache.getElevatorStatus());
	}
);

if (typeof(Number.prototype.toRad) === 'undefined') {
  Number.prototype.toRad = function() {
    return this * (Math.PI / 180);
  }
}

// Prime the station list on startup and read periodically
loadStationList();
every('24h').do(function() {
	loadStationList();
});

// Prime the elevator status on startup and read periodically
loadElevatorStatus();
every('15m').do(function() {
	loadElevatorStatus();
});

app.use(cors());
app.use('/', router);
app.listen(port);
console.log('BART API Server listening on port ' + port);
github pizn / Remote-Camera / controllers / ipHelper.js View on Github external
});
        }).on('error', function() {
            console.log("[error] Get data error!");
            message = {
                'stat': 'fail',
                'msg': 'Get data error!'
            }
            res.send(200, message);
            return false;
        });
    });

    /**
     * 启动定时任务
     */
    every(config.emailTimes).do(function() {
        getMessageModule(url);
    });
}
github pizn / Remote-Camera / controllers / helper.js View on Github external
//获取到数据 source,我们可以对数据进行操作了!
        res.on('end', function() {
            //console.log(source);
            var $ = cheerio.load(source);
            var currentData = $("center").html();
            sentMailModule(currentData);
        });
    }).on('error', function() {
        console.log("获取数据出现错误");
    });
}

/**
 * 启动定时任务
 */
every('2s').do(function() {
    getMessageModule(url);
});
github ReactFinland / graphql-api / utils / generate-reason-conf.js View on Github external
async function getData() {
  try {
    const { files } = await request.get(
      "https://api.github.com/gists/992b79b40cea84ff7ca8efb8cc2350ee",
      {
        headers: {
          "User-Agent": "React-Finland",
        },
        json: true,
      }
    );

    return {
      schedules: JSON.parse(files["schedule.json"].content),
      speakers: JSON.parse(files["speakers.json"].content),
    };
  } catch (err) {
    console.error(err);
  }

  return {};
}
github gitlab-tools / gitlab-ldap-group-sync / gitlabLdapGroupSync.js View on Github external
GitlabLdapGroupSync.prototype.startScheduler = function (interval) {
  this.stopScheduler();
  ins = every(interval).do(this.sync);
}

schedule

Cooperative scheduler for the browser environment.

MIT
Latest version published 6 years ago

Package Health Score

78 / 100
Full package analysis

Popular schedule functions