From 1bad117ab36ced678b3c99b876b5e3eb7baa0750 Mon Sep 17 00:00:00 2001 From: Corey Burmeister Date: Tue, 28 Feb 2017 14:08:42 -0800 Subject: [PATCH] Extend timeout to render_component() This commit extends the `timeout` parameter within `RenderServer.render` to `render_component`. --- react/render.py | 4 ++-- react/render_server.py | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/react/render.py b/react/render.py index 83173d0..447c340 100644 --- a/react/render.py +++ b/react/render.py @@ -4,7 +4,7 @@ from .render_server import render_server -def render_component(path, props=None, to_static_markup=False, renderer=render_server, request_headers=None): +def render_component(path, props=None, to_static_markup=False, renderer=render_server, request_headers=None, timeout=None): if not os.path.isabs(path): abs_path = staticfiles.find(path) if not abs_path: @@ -14,4 +14,4 @@ def render_component(path, props=None, to_static_markup=False, renderer=render_s if not os.path.exists(path): raise ComponentSourceFileNotFound(path) - return renderer.render(path, props, to_static_markup, request_headers) + return renderer.render(path, props, to_static_markup, request_headers, timeout=timeout) diff --git a/react/render_server.py b/react/render_server.py index 33cbf67..a7b1907 100644 --- a/react/render_server.py +++ b/react/render_server.py @@ -20,10 +20,7 @@ def __unicode__(self): class RenderServer(object): - def render( - self, path, props=None, to_static_markup=False, request_headers=None, - timeout=None - ): + def render(self, path, props=None, to_static_markup=False, request_headers=None, timeout=None): url = conf.settings.RENDER_URL if props is not None: