kboss/b/cpcc/cpcworker/get_availableworker.dspy
2025-07-16 14:27:17 +08:00

17 lines
503 B
Plaintext

async def get_availableworker(params_kw={}):
db = DBPools()
# dbname = get_module_dbname('cpcc')
dbname = 'kboss'
ns = {
"clusterid":params_kw.clusterid
}
async with db.sqlorContext(dbname) as sor:
sql = "select cpcid,id,ip,node_status from cpcnode where cpcid = (select cpcid from cpccluster where id = ${clusterid}$) and node_status = '0';"
recs = await sor.sqlExe(sql, ns.copy())
return recs
exception(f'{sql=},{ns=}')
return []
ret = await get_availableworker(params_kw)
return ret