From c60934f9b1e8a08d2e4c4b39d285c13524aa7040 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 2 Feb 2021 16:27:21 +0100 Subject: [PATCH] flows: fix benchmark using wrong context --- authentik/flows/management/commands/benchmark.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/authentik/flows/management/commands/benchmark.py b/authentik/flows/management/commands/benchmark.py index af71e16f5..2ece6fdc0 100644 --- a/authentik/flows/management/commands/benchmark.py +++ b/authentik/flows/management/commands/benchmark.py @@ -1,6 +1,6 @@ """authentik benchmark command""" from csv import DictWriter -from multiprocessing import Manager, Process, cpu_count +from multiprocessing import Manager, Process, cpu_count, get_context from sys import stdout from time import time @@ -15,9 +15,11 @@ from authentik.flows.models import Flow from authentik.flows.planner import PLAN_CONTEXT_PENDING_USER, FlowPlanner LOGGER = get_logger() +FORK_CTX = get_context("fork") +PROCESS_CLASS = FORK_CTX.Process -class FlowPlanProcess(Process): # pragma: no cover +class FlowPlanProcess(PROCESS_CLASS): # pragma: no cover """Test process which executes flow planner""" def __init__(self, index, return_dict, flow, user) -> None: