mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-09 07:16:04 +00:00
chore: 代码格式优化
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import threading
|
||||
from pkg.utils import ThreadCtl
|
||||
|
||||
|
||||
context = {
|
||||
'inst': {
|
||||
@@ -78,14 +80,15 @@ def get_plugin_host():
|
||||
context_lock.release()
|
||||
return t
|
||||
|
||||
|
||||
def set_thread_ctl(inst):
|
||||
context_lock.acquire()
|
||||
context['pool_ctl'] = inst
|
||||
context_lock.release()
|
||||
|
||||
from pkg.utils import ThreadCtl
|
||||
|
||||
def get_thread_ctl() -> ThreadCtl:
|
||||
context_lock.acquire()
|
||||
t = context['pool_ctl']
|
||||
t: ThreadCtl = context['pool_ctl']
|
||||
context_lock.release()
|
||||
return t
|
||||
return t
|
||||
|
||||
Reference in New Issue
Block a user