Skip to content

Commit dc07f42

Browse files
committed
Fixed keeping a lock unneededly while scanning is complete
This change little effect on the application itself, as the lock.aquire() was never touched again when the detection already took place. Since Django initializes the application first, this locking wasn't really needed anymore for web-based applications.
1 parent 79b6f5f commit dc07f42

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

fluent_contents/extensions/pluginpool.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,13 @@ def _import_plugins(self):
232232
if self.detected:
233233
return
234234

235-
# In some cases, plugin scanning may start during a request.
236-
# Make sure there is only one thread scanning for plugins.
237-
self.scanLock.acquire()
238-
if self.detected:
239-
return # previous threaded released + completed
240-
241235
try:
236+
# In some cases, plugin scanning may start during a request.
237+
# Make sure there is only one thread scanning for plugins.
238+
self.scanLock.acquire()
239+
if self.detected:
240+
return # previous threaded released + completed
241+
242242
import_apps_submodule("content_plugins")
243243
self.detected = True
244244
finally:

0 commit comments

Comments
 (0)