Now SQL API is able to disable Batch Service using argv param --no-batch
This commit is contained in:
parent
8d29e6b45c
commit
078eb7706b
@ -28,7 +28,7 @@ var CacheStatusController = require('./controllers/cache_status_controller');
|
||||
var HealthCheckController = require('./controllers/health_check_controller');
|
||||
var VersionController = require('./controllers/version_controller');
|
||||
|
||||
var Batch = require('../batch');
|
||||
var batch = require('../batch');
|
||||
|
||||
process.env.PGAPPNAME = process.env.PGAPPNAME || 'cartodb_sqlapi';
|
||||
|
||||
@ -180,9 +180,10 @@ function App() {
|
||||
var versionController = new VersionController();
|
||||
versionController.route(app);
|
||||
|
||||
if (global.settings.environment !== 'test') {
|
||||
var batch = new Batch(metadataBackend);
|
||||
batch.start();
|
||||
var isBatchProcess = process.argv.indexOf('--no-batch') === -1;
|
||||
|
||||
if (global.settings.environment !== 'test' && isBatchProcess) {
|
||||
batch(metadataBackend).start();
|
||||
}
|
||||
|
||||
return app;
|
||||
|
@ -1,7 +1,6 @@
|
||||
var _ = require('underscore');
|
||||
var queue = require('queue-async');
|
||||
var Batch = require('../../batch');
|
||||
// var Batch = require('../../batch/batch');
|
||||
var batchFactory = require('../../batch');
|
||||
var JobPublisher = require('../../batch/job_publisher');
|
||||
var JobQueue = require('../../batch/job_queue');
|
||||
var UserIndexer = require('../../batch/user_indexer');
|
||||
@ -22,7 +21,7 @@ describe('batch module', function() {
|
||||
var userIndexer = new UserIndexer(metadataBackend);
|
||||
var jobBackend = new JobBackend(metadataBackend, jobQueue, jobPublisher, userIndexer);
|
||||
|
||||
var batch = new Batch(metadataBackend);
|
||||
var batch = batchFactory(metadataBackend);
|
||||
|
||||
before(function () {
|
||||
batch.start();
|
||||
|
Loading…
Reference in New Issue
Block a user