mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Removed cron from every route
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user