瀏覽代碼

refactor: move `min_block_size` one level up

Thales Macedo Garitezi 1 年之前
父節點
當前提交
4859cebd9f

+ 10 - 10
apps/emqx_bridge_azure_blob_storage/src/emqx_bridge_azure_blob_storage_action_schema.erl

@@ -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) ->

+ 2 - 2
apps/emqx_bridge_azure_blob_storage/src/emqx_bridge_azure_blob_storage_connector.erl

@@ -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,

+ 1 - 3
apps/emqx_bridge_azure_blob_storage/test/emqx_bridge_azure_blob_storage_SUITE.erl

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