File tree 2 files changed +5
-6
lines changed
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!
34
34
35
35
### Fixed
36
36
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.
38
38
39
39
## [ 5.1.1] - 2024-12-02
40
40
Original file line number Diff line number Diff line change 62
62
+ r"\s*%}"
63
63
)
64
64
FILE_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" )
65
66
66
67
67
68
async def render_view (
@@ -354,17 +355,15 @@ class SyncLayout(Layout):
354
355
355
356
def __enter__ (self ):
356
357
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 ()
359
359
return self
360
360
361
361
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 ()
363
363
self .loop .close ()
364
- self .thread .shutdown ()
365
364
366
365
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 ()
368
367
369
368
370
369
def get_pk (model ):
You can’t perform that action at this time.
0 commit comments