File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ Don't forget to remove deprecated code on each major release!
3434
3535### Fixed
3636
37- - Fixed bug where prerendered components could generate a ` SynchronousOnlyOperation ` exception if they utilize the Django ORM.
37+ - Fixed bug where pre-rendered components could generate a ` SynchronousOnlyOperation ` exception if they utilize the Django ORM.
3838
3939## [ 5.1.1] - 2024-12-02
4040
Original file line number Diff line number Diff line change 6262 + r"\s*%}"
6363)
6464FILE_ASYNC_ITERATOR_THREAD = ThreadPoolExecutor (max_workers = 1 , thread_name_prefix = "ReactPy-Django-FileAsyncIterator" )
65+ SYNC_LAYOUT_THREAD = ThreadPoolExecutor (max_workers = 1 , thread_name_prefix = "ReactPy-Django-SyncLayout" )
6566
6667
6768async def render_view (
@@ -354,17 +355,15 @@ class SyncLayout(Layout):
354355
355356 def __enter__ (self ):
356357 self .loop = asyncio .new_event_loop ()
357- self .thread = ThreadPoolExecutor (max_workers = 1 )
358- self .thread .submit (self .loop .run_until_complete , self .__aenter__ ()).result ()
358+ SYNC_LAYOUT_THREAD .submit (self .loop .run_until_complete , self .__aenter__ ()).result ()
359359 return self
360360
361361 def __exit__ (self , exc_type , exc_val , exc_tb ):
362- self . thread .submit (self .loop .run_until_complete , self .__aexit__ ()).result ()
362+ SYNC_LAYOUT_THREAD .submit (self .loop .run_until_complete , self .__aexit__ ()).result ()
363363 self .loop .close ()
364- self .thread .shutdown ()
365364
366365 def sync_render (self ):
367- return self . thread .submit (self .loop .run_until_complete , self .render ()).result ()
366+ return SYNC_LAYOUT_THREAD .submit (self .loop .run_until_complete , self .render ()).result ()
368367
369368
370369def get_pk (model ):
You can’t perform that action at this time.
0 commit comments