flows: fix benchmark using wrong context

This commit is contained in:
Jens Langhammer 2021-02-02 16:27:21 +01:00
parent 09bdcfaab0
commit c60934f9b1
1 changed files with 4 additions and 2 deletions

View File

@ -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: