Skip to content

Commit

Permalink
Extend timeout to render_component()
Browse files Browse the repository at this point in the history
This commit extends the `timeout` parameter within `RenderServer.render`
to `render_component`.
  • Loading branch information
cburmeister committed Feb 28, 2017
1 parent d8e8b45 commit 1bad117
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions react/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
5 changes: 1 addition & 4 deletions react/render_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1bad117

Please sign in to comment.