bugfix
This commit is contained in:
parent
eaab349d53
commit
a618f72b45
@ -60,11 +60,11 @@ NODE_EXECUTION_TABLE = {
|
|||||||
{"name": "ctx_ext", "type": "text"},
|
{"name": "ctx_ext", "type": "text"},
|
||||||
{"name": "status", "type": "str", "length": 16},
|
{"name": "status", "type": "str", "length": 16},
|
||||||
{"name": "error", "type": "text"},
|
{"name": "error", "type": "text"},
|
||||||
{"name": "input", "type": "text"},
|
{"name": "input", "type": "text"},
|
||||||
{"name": "output", "type": "text"},
|
{"name": "output", "type": "text"},
|
||||||
{"name": "subinst_id", "type": "str", "length": 32},
|
{"name": "subinst_id", "type": "str", "length": 32},
|
||||||
{"name": "role", "type": "str", "length": 64},
|
{"name": "role", "type": "str", "length": 64},
|
||||||
{"name": "assignee", "type": "str", "length": 64},
|
{"name": "assignee", "type": "str", "length": 64},
|
||||||
{"name": "running_at", "type": "timestamp"},
|
{"name": "running_at", "type": "timestamp"},
|
||||||
{"name": "stopping_at", "type": "timestamp"},
|
{"name": "stopping_at", "type": "timestamp"},
|
||||||
{"name": "created_at", "type": "timestamp"}
|
{"name": "created_at", "type": "timestamp"}
|
||||||
@ -112,23 +112,23 @@ from ahserver.serverenv import ServerEnv
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
def extract_some_value(s):
|
def extract_some_value(s):
|
||||||
"""
|
"""
|
||||||
从 'some(100)' 或 'some(50%)' 中提取数值。
|
从 'some(100)' 或 'some(50%)' 中提取数值。
|
||||||
Args:
|
Args:
|
||||||
s (str): 输入的字符串
|
s (str): 输入的字符串
|
||||||
|
|
||||||
Returns: float类型值, 小于1的小数点数字(%模式)或其他
|
Returns: float类型值, 小于1的小数点数字(%模式)或其他
|
||||||
"""
|
"""
|
||||||
# 正则解释: 匹配 some( 后跟数字,然后是可选的 % 符号,最后是 )
|
# 正则解释: 匹配 some( 后跟数字,然后是可选的 % 符号,最后是 )
|
||||||
match = re.search(r'some\((\d+)(%)?\)', s)
|
match = re.search(r'some\((\d+)(%)?\)', s)
|
||||||
if match:
|
if match:
|
||||||
value = float(match.group(1)) # 提取数字部分并转为整数
|
value = float(match.group(1)) # 提取数字部分并转为整数
|
||||||
unit = match.group(2) # 提取单位部分 (%)
|
unit = match.group(2) # 提取单位部分 (%)
|
||||||
if unit == '%':
|
if unit == '%':
|
||||||
return value / 100.0
|
return value / 100.0
|
||||||
return value
|
return value
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
class FlowEngine:
|
class FlowEngine:
|
||||||
|
|
||||||
@ -415,7 +415,7 @@ where node_id in ${backnodes}$
|
|||||||
set status = 'cancelled'
|
set status = 'cancelled'
|
||||||
where status in ['pending', 'running']
|
where status in ['pending', 'running']
|
||||||
and node_id in ${backnodes}$
|
and node_id in ${backnodes}$
|
||||||
and instance_id = ${instance_id}$"""
|
and instance_id = ${instance_id}$"""
|
||||||
await sor.sqlExe(sql, {
|
await sor.sqlExe(sql, {
|
||||||
'backnodes': backnodes,
|
'backnodes': backnodes,
|
||||||
'instance_id': inst['id']
|
'instance_id': inst['id']
|
||||||
@ -426,8 +426,8 @@ where status in ['pending', 'running']
|
|||||||
where instance_id=${instance_id}$
|
where instance_id=${instance_id}$
|
||||||
and to_node_id = ${node_id}$"""
|
and to_node_id = ${node_id}$"""
|
||||||
trecs = sor.sqlExe(sql, {
|
trecs = sor.sqlExe(sql, {
|
||||||
'node_id': node['id'],
|
'node_id': node['id'],
|
||||||
'instance_id': inst['id']
|
'instance_id': inst['id']
|
||||||
})
|
})
|
||||||
if some >= 1 and some <= len(trecs):
|
if some >= 1 and some <= len(trecs):
|
||||||
return True
|
return True
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user