Remove .list() from job service

This commit is contained in:
Raul Ochoa 2016-08-30 18:51:51 +02:00
parent 38e07bb66d
commit 05ada98124
2 changed files with 0 additions and 57 deletions

View File

@ -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) { JobService.prototype.create = function (data, callback) {
try { try {
var job = JobFactory.create(data); var job = JobFactory.create(data);

View File

@ -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) { it('.cancel() should cancel a running job', function (done) {
var job = createWadusDataJob(); var job = createWadusDataJob();
job.query = 'select pg_sleep(3)'; job.query = 'select pg_sleep(3)';