Skip to content

Instantly share code, notes, and snippets.

@mooyoul
Created May 31, 2016 07:18
Show Gist options
  • Save mooyoul/3a439464e8b961252ef7a5d57f02f2b4 to your computer and use it in GitHub Desktop.
Save mooyoul/3a439464e8b961252ef7a5d57f02f2b4 to your computer and use it in GitHub Desktop.
kue-create.js
'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