[error] if pp params only have one value and this value's length is bigger than 40, pp_params will be empty.
[how] add all values to pp_params. if one value's length + pp_params's length bigger then 40, then cut value.
Signed-off-by: Wei Jihui weijihuiall@163.com --- src/scheduler/pp_params.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/scheduler/pp_params.cr b/src/scheduler/pp_params.cr index 03bf0b8..dc24938 100644 --- a/src/scheduler/pp_params.cr +++ b/src/scheduler/pp_params.cr @@ -37,7 +37,8 @@ class Job value = format_string(hash[key].to_s) next if 0 == value.size
- if 40 > value.size + items_size + values.size + if items_size < 40 + value = value[0...(40-items_size)] if items_size + value.size > 40 values << value items_size += value.size else
On Tue, Mar 09, 2021 at 05:47:10PM +0800, Wei Jihui wrote:
[error] if pp params only have one value and this value's length is bigger than 40, pp_params will be empty.
That must be your first params is bigger than 40, otherwise it will append the short params.
Thanks, Xueliang
[how] add all values to pp_params. if one value's length + pp_params's length bigger then 40, then cut value.
Signed-off-by: Wei Jihui weijihuiall@163.com
src/scheduler/pp_params.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/scheduler/pp_params.cr b/src/scheduler/pp_params.cr index 03bf0b8..dc24938 100644 --- a/src/scheduler/pp_params.cr +++ b/src/scheduler/pp_params.cr @@ -37,7 +37,8 @@ class Job value = format_string(hash[key].to_s) next if 0 == value.size
if 40 > value.size + items_size + values.size
if items_size < 40
value = value[0...(40-items_size)] if items_size + value.size > 40 values << value items_size += value.size else
-- 2.23.0