Created
May 31, 2016 07:18
-
-
Save mooyoul/3a439464e8b961252ef7a5d57f02f2b4 to your computer and use it in GitHub Desktop.
kue-create.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const | |
kue = require('kue'), | |
moment = require('moment'), | |
queue = kue.createQueue(); | |
/* | |
var job = queue.create('sitemap', { | |
title: `Sitemap build #${moment(new Date()).format('YYYYMMDDHHmmss')}` | |
}).save( function(err){ | |
if( !err ) console.log( job.id ); | |
}); | |
*/ | |
/* | |
var job = queue.create('prerender', { | |
title: `Prerender`, | |
url: 'https://www.lawtalk.co.kr' | |
}).on('complete', (data) => { | |
console.log(data); | |
}).save( function(err){ | |
if( !err ) console.log( job.id ); | |
}); | |
*/ | |
var job = queue.create('snapshot', { | |
type: 'full', | |
title: `Snapshot build #${moment(new Date()).format('YYYYMMDDHHmmss')}, Full build` | |
}).save( function(err){ | |
if( !err ) console.log( job.id ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment