Removed cron from every route

This commit is contained in:
Keith Holliday
2017-06-08 14:03:30 -07:00
parent db0b0d6b6d
commit 137636cb40
2 changed files with 0 additions and 5 deletions

View File

@@ -343,7 +343,6 @@ api.getGroups = {
api.getGroup = {
method: 'GET',
url: '/groups/:groupId',
runCron: false, // Do not run cron to avoid double cronning because it's called in parallel to GET /user when the site loads
middlewares: [authWithHeaders()],
async handler (req, res) {
let user = res.locals.user;

View File

@@ -27,10 +27,6 @@ module.exports.readController = function readController (router, controller) {
let middlewaresToAdd = [getUserLanguage];
if (authMiddlewareIndex !== -1) { // the user will be authenticated, getUserLanguage and cron after authentication
if (!(runCron === false)) { // eslint-disable-line no-extra-parens
middlewaresToAdd.push(cron);
}
if (authMiddlewareIndex === middlewares.length - 1) {
middlewares.push(...middlewaresToAdd);
} else {