Skip to content

Commit

Permalink
Small refactoring for controllers/run (#1933)
Browse files Browse the repository at this point in the history
  • Loading branch information
melikhov-dev authored Dec 12, 2024
1 parent d6b80c0 commit 922279f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/server/components/charts-engine/controllers/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import get from 'lodash/get';
import type {ChartsEngine} from '..';
import {Feature, isEnabledServerFeature} from '../../../../shared';
import {DeveloperModeCheckStatus} from '../../../../shared/types';
import {registry} from '../../../registry';
import type {ResolvedConfig} from '../components/storage/types';
import {getDuration} from '../components/utils';

Expand All @@ -24,7 +23,6 @@ export const runController = (
) => {
return async function chartsRunController(req: Request, res: Response) {
const {ctx} = req;
const app = registry.getApp();

// We need it because of timeout error after 120 seconds
// https://forum.nginx.org/read.php?2,214230,214239#msg-214239
Expand Down Expand Up @@ -131,12 +129,12 @@ export const runController = (
}

if (
isEnabledServerFeature(app.nodekit.ctx, Feature.ShouldCheckEditorAccess) &&
isEnabledServerFeature(ctx, Feature.ShouldCheckEditorAccess) &&
runnerFound.name === 'editor'
) {
const {checkRequestForDeveloperModeAccess} = req.ctx.get('gateway');
const {checkRequestForDeveloperModeAccess} = ctx.get('gateway');
const checkResult = await checkRequestForDeveloperModeAccess({
ctx: req.ctx,
ctx,
});

if (checkResult === DeveloperModeCheckStatus.Forbidden) {
Expand Down

0 comments on commit 922279f

Please sign in to comment.