refactor: move `min_block_size` one level up

This commit is contained in:
Thales Macedo Garitezi 2024-05-29 09:59:13 -03:00
parent 9a1d3ea04f
commit 4859cebd9f
3 changed files with 13 additions and 15 deletions

View File

@ -120,6 +120,16 @@ fields(aggreg_parameters) ->
desc => ?DESC("aggregated_blob_template"),
required => true
}
)},
{min_block_size,
mk(
emqx_schema:bytesize(),
#{
default => <<"10mb">>,
importance => ?IMPORTANCE_HIDDEN,
required => true,
validator => fun block_size_validator/1
}
)}
| fields(common_action_parameters)
];
@ -144,16 +154,6 @@ fields(aggregation) ->
default => 1_000_000,
desc => ?DESC("aggregation_max_records")
}
)},
{min_block_size,
mk(
emqx_schema:bytesize(),
#{
default => <<"10mb">>,
importance => ?IMPORTANCE_HIDDEN,
required => true,
validator => fun block_size_validator/1
}
)}
];
fields(common_action_parameters) ->

View File

@ -526,12 +526,12 @@ install_action(#{parameters := #{mode := aggregated}} = ActionConfig, ConnState)
aggregation := #{
container := ContainerOpts,
max_records := MaxRecords,
min_block_size := MinBlockSize,
time_interval := TimeInterval
},
container := ContainerName,
blob := BlobTemplateStr,
max_block_size := MaxBlockSize
max_block_size := MaxBlockSize,
min_block_size := MinBlockSize
}
} = ActionConfig,
Type = ?ACTION_TYPE_BIN,

View File

@ -615,9 +615,7 @@ t_aggreg_pending_upload_restart(Config) ->
#{
<<"parameters">> =>
#{
<<"aggregation">> => #{
<<"min_block_size">> => <<"1024B">>
}
<<"min_block_size">> => <<"1024B">>
}
}
)