crond
v0.0.5
Published
distributed crond
Downloads
10
Readme
crond
distributed cron server store task and log into mysql
mysql schema
cron tab:
field | type --- | --- uid | varchar(255) rule | varchar(255) next | datetime handler | varchar(255)
cron log:
field | type --- | --- id | int(11) uid | varchar(255) create_time | datetime start_time | datetime end_time | datetime success | tinyint(1)(default 0) message | varchar(255)
var crond = require('crond');
var crontab = new Crond('mysql://name:password@host:port/db', 'cron_tab', 'cron_log');
crontab.add(uid, rule); //if duplicated nothing happend
crontab.job(uid, function() {}); //multiple job only tragger once