modify: 将 QApplication 实例初始化调整到调度器 start 阶段
This commit is contained in:
parent
05ed2745b0
commit
45817e5542
@ -32,8 +32,6 @@ class QtQueueScheduler(BaseScheduler):
|
||||
self,
|
||||
config: SchedulerConfig = SchedulerConfig(),
|
||||
):
|
||||
# 确保有 QApplication 实例(对于 GUI 应用)
|
||||
self._ensure_qapplication()
|
||||
|
||||
# 初始化队列操作
|
||||
self.queue_operation = ShardedQueueOperation(
|
||||
@ -137,6 +135,8 @@ class QtQueueScheduler(BaseScheduler):
|
||||
|
||||
def start(self):
|
||||
"""启动所有调度器组件"""
|
||||
# 确保有 QApplication 实例(对于 GUI 应用)
|
||||
self._ensure_qapplication()
|
||||
self.receive_scheduler.start()
|
||||
self.task_scheduler.start()
|
||||
self.cleanup_scheduler.start_cleanup()
|
||||
|
||||
@ -26,6 +26,3 @@ dev = [
|
||||
"twine>=4.0.2",
|
||||
"maturin>=1.9.4",
|
||||
]
|
||||
|
||||
[[tool.uv.index]]
|
||||
url = "https://pypi.tuna.tsinghua.edu.cn/simple"
|
||||
|
||||
@ -16,6 +16,8 @@ class QueueOperation:
|
||||
def remove_expired_messages(self, days: int) -> None: ...
|
||||
|
||||
class ShardedQueueOperation:
|
||||
@property
|
||||
def shard_num(self) -> int: ...
|
||||
@property
|
||||
def db_dir(self) -> str: ...
|
||||
def __init__(self, shard_num: int, queue_name: str): ...
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user