Skip to content

Instantly share code, notes, and snippets.

@evantahler
Created December 28, 2012 17:04
Show Gist options
  • Save evantahler/4399793 to your computer and use it in GitHub Desktop.
Save evantahler/4399793 to your computer and use it in GitHub Desktop.
A way to checkout the status of your task queue in actionHero
var action = {};
/////////////////////////////////////////////////////////////////////
// metadata
action.name = "inspectTasks";
action.description = "I show you what it going on";
action.inputs = {
"required" : [],
"optional" : []
};
action.outputExample = {}
/////////////////////////////////////////////////////////////////////
// functional
action.run = function(api, connection, next){
api.utils.checkAuth(api, connection, next, function(err, dbUser){
api.tasks.inspectTasks(api, function(err, tasks){
if(err != null){ connection.error = err }{
connection.response.tasks = tasks;
next(connection, true);
}
});
});
};
/////////////////////////////////////////////////////////////////////
// exports
exports.action = action;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment