auto-sync: 2026-05-18 00:26:28
This commit is contained in:
@@ -85,13 +85,17 @@ class Queries:
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
def pending_dispatchable(self) -> List[Task]:
|
||||
def pending_dispatchable(self, card_id: Optional[str] = None) -> List[Task]:
|
||||
"""查询可调度的 pending 任务(依赖已满足)"""
|
||||
conn = self._conn()
|
||||
try:
|
||||
rows = conn.execute(
|
||||
"SELECT * FROM tasks WHERE status='pending' ORDER BY priority ASC"
|
||||
).fetchall()
|
||||
query = "SELECT * FROM tasks WHERE status='pending'"
|
||||
params: list = []
|
||||
if card_id:
|
||||
query += " AND card_id=?"
|
||||
params.append(card_id)
|
||||
query += " ORDER BY priority ASC"
|
||||
rows = conn.execute(query, params).fetchall()
|
||||
result = []
|
||||
for r in rows:
|
||||
deps = json.loads(r["depends_on"] or "[]")
|
||||
|
||||
Reference in New Issue
Block a user