using the new TYPES
This commit is contained in:
parent
a97c25e914
commit
52e4dfa728
@ -45,7 +45,7 @@ JobController.prototype.route = function (app) {
|
|||||||
bodyParserMiddleware(),
|
bodyParserMiddleware(),
|
||||||
checkBodyPayloadSize(),
|
checkBodyPayloadSize(),
|
||||||
handleQueryMiddleware(true),
|
handleQueryMiddleware(true),
|
||||||
logMiddleware(),
|
logMiddleware(logMiddleware.TYPES.JOB),
|
||||||
jobMiddlewares('create', createJob, RATE_LIMIT_ENDPOINTS_GROUPS.JOB_CREATE)
|
jobMiddlewares('create', createJob, RATE_LIMIT_ENDPOINTS_GROUPS.JOB_CREATE)
|
||||||
);
|
);
|
||||||
app.get(
|
app.get(
|
||||||
|
@ -47,7 +47,7 @@ QueryController.prototype.route = function (app) {
|
|||||||
connectionParamsMiddleware(this.userDatabaseService),
|
connectionParamsMiddleware(this.userDatabaseService),
|
||||||
timeoutLimitsMiddleware(this.metadataBackend),
|
timeoutLimitsMiddleware(this.metadataBackend),
|
||||||
handleQueryMiddleware(),
|
handleQueryMiddleware(),
|
||||||
logMiddleware(),
|
logMiddleware(logMiddleware.TYPES.QUERY),
|
||||||
this.handleQuery.bind(this),
|
this.handleQuery.bind(this),
|
||||||
errorMiddleware()
|
errorMiddleware()
|
||||||
];
|
];
|
||||||
|
@ -6,6 +6,7 @@ const server = require('../../app/server')();
|
|||||||
const assert = require('../support/assert');
|
const assert = require('../support/assert');
|
||||||
const qs = require('querystring');
|
const qs = require('querystring');
|
||||||
const BatchTestClient = require('../support/batch-test-client');
|
const BatchTestClient = require('../support/batch-test-client');
|
||||||
|
const { TYPES } = require('../../app/middlewares/log');
|
||||||
|
|
||||||
const QUERY = `SELECT 14 as foo`;
|
const QUERY = `SELECT 14 as foo`;
|
||||||
const API_KEY = 1234;
|
const API_KEY = 1234;
|
||||||
@ -73,7 +74,8 @@ describe('Log middleware', function() {
|
|||||||
assert.deepEqual(log, {
|
assert.deepEqual(log, {
|
||||||
request: {
|
request: {
|
||||||
sql: {
|
sql: {
|
||||||
simple: QUERY
|
type: TYPES.QUERY,
|
||||||
|
sql: QUERY
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -104,7 +106,8 @@ describe('Log middleware', function() {
|
|||||||
assert.deepEqual(log, {
|
assert.deepEqual(log, {
|
||||||
request: {
|
request: {
|
||||||
sql: {
|
sql: {
|
||||||
simple: QUERY
|
type: TYPES.JOB,
|
||||||
|
sql: QUERY
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -123,7 +126,8 @@ describe('Log middleware', function() {
|
|||||||
assert.deepEqual(log, {
|
assert.deepEqual(log, {
|
||||||
request: {
|
request: {
|
||||||
sql: {
|
sql: {
|
||||||
multiple: [QUERY, QUERY]
|
type: TYPES.JOB,
|
||||||
|
sql: [QUERY, QUERY]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -202,7 +206,8 @@ describe('Log middleware', function() {
|
|||||||
assert.deepEqual(log, {
|
assert.deepEqual(log, {
|
||||||
request: {
|
request: {
|
||||||
sql: {
|
sql: {
|
||||||
simple: QUERY.substring(0, global.settings.maxQueriesLogLength)
|
type: TYPES.QUERY.substring(0, global.settings.maxQueriesLogLength),
|
||||||
|
sql: QUERY.substring(0, global.settings.maxQueriesLogLength)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user