From 05ada98124e3a7ca30031d989b38c61c56c9f694 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Tue, 30 Aug 2016 18:51:51 +0200 Subject: [PATCH] Remove .list() from job service --- batch/job_service.js | 25 ----------------- test/integration/batch/job_service.test.js | 32 ---------------------- 2 files changed, 57 deletions(-) diff --git a/batch/job_service.js b/batch/job_service.js index a8a8501d..938e3a5e 100644 --- a/batch/job_service.js +++ b/batch/job_service.js @@ -29,31 +29,6 @@ JobService.prototype.get = function (job_id, callback) { }); }; -JobService.prototype.list = function (user, callback) { - this.jobBackend.list(user, function (err, dataList) { - if (err) { - return callback(err); - } - - var jobList = dataList.map(function (data) { - var job; - - try { - job = JobFactory.create(data); - } catch (err) { - return debug(err); - } - - return job; - }) - .filter(function (job) { - return job !== undefined; - }); - - callback(null, jobList); - }); -}; - JobService.prototype.create = function (data, callback) { try { var job = JobFactory.create(data); diff --git a/test/integration/batch/job_service.test.js b/test/integration/batch/job_service.test.js index cd704006..f1a7617f 100644 --- a/test/integration/batch/job_service.test.js +++ b/test/integration/batch/job_service.test.js @@ -139,38 +139,6 @@ describe('job service', function() { }); }); - it('.list() should return a list of user\'s jobs', function (done) { - jobService.create(createWadusDataJob(), function (err, jobCreated) { - if (err) { - return done(err); - } - - jobService.list(USER, function (err, jobs) { - var found = false; - - assert.ok(!err, err); - assert.ok(jobs.length); - - jobs.forEach(function (job) { - if (job.data.job_id === jobCreated.data.job_id) { - found = true; - } - }); - - assert.ok(found, 'Job expeted to be listed not found'); - done(); - }); - }); - }); - - it('.list() should return a empty list for nonexitent user', function (done) { - jobService.list('wadus_user', function (err, jobs) { - assert.ok(!err, err); - assert.ok(!jobs.length); - done(); - }); - }); - it('.cancel() should cancel a running job', function (done) { var job = createWadusDataJob(); job.query = 'select pg_sleep(3)';