CartoDB-SQL-API/batch/job_service.js

20 lines
503 B
JavaScript
Raw Normal View History

2015-12-10 03:17:45 +08:00
'use strict';
function JobService(userDatabaseMetadataService, job) {
this.userDatabaseMetadataService = userDatabaseMetadataService;
this.job = job;
2015-12-10 03:17:45 +08:00
}
JobService.prototype.run = function (username, callback) {
2015-12-10 03:17:45 +08:00
var self = this;
this.userDatabaseMetadataService.getUserMetadata(username, function (err, userDatabaseMetadata) {
2015-12-10 03:17:45 +08:00
if (err) {
return callback(err);
}
self.job.run(userDatabaseMetadata, callback);
2015-12-10 03:17:45 +08:00
});
};
module.exports = JobService;