From 0aaf036d780140e9b7058f6a87bc1114fa835188 Mon Sep 17 00:00:00 2001 From: Oleg Date: Thu, 18 Jun 2015 15:50:42 -0400 Subject: [PATCH] Support of setting TTL through JSON API options --- lib/http/routes/json.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/http/routes/json.js b/lib/http/routes/json.js index 453ed8c9..b8bb0666 100755 --- a/lib/http/routes/json.js +++ b/lib/http/routes/json.js @@ -153,7 +153,8 @@ exports.createJob = function( req, res ) { if( options.searchKeys ) job.searchKeys(options.searchKeys); if( options.backoff ) job.backoff(options.backoff); if( options.removeOnComplete ) job.removeOnComplete(options.removeOnComplete); - + if( options.ttl ) job.ttl(options.ttl); + job.save(function( err ) { if( err ) { return next({ error: err.message }, null, 500);