backend scripts should not be async because of transaction management

This commit is contained in:
zadam
2021-05-15 22:57:23 +02:00
parent a65eda5e4a
commit 04f249e800
6 changed files with 52 additions and 47 deletions

View File

@@ -6,7 +6,7 @@ const cls = require('../services/cls');
const sql = require("../services/sql");
const becca = require("../services/becca/becca");
async function handleRequest(req, res) {
function handleRequest(req, res) {
// express puts content after first slash into 0 index element
const path = req.params.path + req.params[0];
@@ -72,7 +72,7 @@ async function handleRequest(req, res) {
function register(router) {
// explicitly no CSRF middleware since it's meant to allow integration from external services
router.all('/custom/:path*', async (req, res, next) => {
router.all('/custom/:path*', (req, res, next) => {
cls.namespace.bindEmitter(req);
cls.namespace.bindEmitter(res);