Skip to content

Commit c2c46fc

Browse files
committed
Moved the RENDER flag checks further up the chain to avoid some unnecessary computations
1 parent 93c8f68 commit c2c46fc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

react/render_server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ def render(self, path, data=None, to_static_markup=False):
2929
else:
3030
props = None
3131

32+
if not conf.settings.RENDER:
33+
return RenderedComponent('', props)
34+
3235
options = {
3336
'path': path,
3437
'serializedProps': props,
@@ -37,9 +40,6 @@ def render(self, path, data=None, to_static_markup=False):
3740
serialized_options = json.dumps(options)
3841
options_hash = hashlib.sha1(serialized_options.encode('utf-8')).hexdigest()
3942

40-
if not conf.settings.RENDER:
41-
return RenderedComponent('', props)
42-
4343
try:
4444
res = requests.post(
4545
self.url,

0 commit comments

Comments
 (0)