Skip to content

Commit

Permalink
removed unnecessary code
Browse files Browse the repository at this point in the history
Signed-off-by: Tanmaya Panda <[email protected]>
  • Loading branch information
tanmaya-panda1 committed Mar 14, 2024
1 parent 61de75c commit c9ab3af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
13 changes: 3 additions & 10 deletions plugins/out_azure_kusto/azure_kusto.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ flb_sds_t execute_ingest_csl_command(struct flb_azure_kusto *ctx, const char *cs
flb_sds_t resp = NULL;

/* setting default connection timeout to kusto ingest endpoint */
ctx->u->base.net.connect_timeout = ctx->kusto_endpoint_connect_timeout;
ctx->u->base.net.connect_timeout = ctx->kusto_endpoint_connection_timeout;

/* Get upstream connection */
u_conn = flb_upstream_conn_get(ctx->u);
Expand Down Expand Up @@ -222,13 +222,6 @@ static int cb_azure_kusto_init(struct flb_output_instance *ins, struct flb_confi
return -1;
}

const char *tmp = flb_output_get_property("kusto_endpoint_connect_timeout", ins);
if (tmp != NULL) {
ctx->kusto_endpoint_connect_timeout = strtol(tmp, NULL, 0);
} else {
ctx->kusto_endpoint_connect_timeout = FLB_AZURE_KUSTO_ENDPOINT_CONNECTION_TIMEOUT;
}

flb_output_set_context(ins, ctx);

/* Network mode IPv6 */
Expand Down Expand Up @@ -472,8 +465,8 @@ static struct flb_config_map config_map[] = {
offsetof(struct flb_azure_kusto, time_key),
"The key name of the time. If 'include_time_key' is false, "
"This property is ignored"},
{FLB_CONFIG_MAP_TIME, "kusto_endpoint_connect_timeout", FLB_AZURE_KUSTO_ENDPOINT_CONNECTION_TIMEOUT, 0, FLB_TRUE,
offsetof(struct flb_azure_kusto, kusto_endpoint_connect_timeout),
{FLB_CONFIG_MAP_TIME, "kusto_endpoint_connection_timeout", FLB_AZURE_KUSTO_INGEST_ENDPOINT_CONNECTION_TIMEOUT, 0, FLB_TRUE,
offsetof(struct flb_azure_kusto, kusto_endpoint_connection_timeout),
"Set the connection timeout of various kusto endpoints (kusto ingest endpoint, kusto ingestion blob endpoint, kusto ingestion blob endpoint) in seconds"},
/* EOF */
{0}};
Expand Down
4 changes: 2 additions & 2 deletions plugins/out_azure_kusto/azure_kusto.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

#define FLB_AZURE_KUSTO_RESOURCES_LOAD_INTERVAL_SEC 3600

#define FLB_AZURE_KUSTO_CONNECTION_ENDPOINT_CONNECTION_TIMEOUT "60"
#define FLB_AZURE_KUSTO_INGEST_ENDPOINT_CONNECTION_TIMEOUT "60"

struct flb_azure_kusto_resources {
struct flb_upstream_ha *blob_ha;
Expand All @@ -73,7 +73,7 @@ struct flb_azure_kusto {
flb_sds_t ingestion_mapping_reference;

/* connection configuration */
int kusto_endpoint_connect_timeout;
int kusto_endpoint_connection_timeout;

/* records configuration */
flb_sds_t log_key;
Expand Down
4 changes: 2 additions & 2 deletions plugins/out_azure_kusto/azure_kusto_ingest.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static flb_sds_t azure_kusto_create_blob(struct flb_azure_kusto *ctx, flb_sds_t
}

/* setting default connection timeout to kusto azure blob endpoint */
ctx->u->base.net.connect_timeout = ctx->kusto_endpoint_connect_timeout;
ctx->u->base.net.connect_timeout = ctx->kusto_endpoint_connection_timeout;

u_conn = flb_upstream_conn_get(u_node->u);

Expand Down Expand Up @@ -352,7 +352,7 @@ static int azure_kusto_enqueue_ingestion(struct flb_azure_kusto *ctx, flb_sds_t
}

/* setting default connection timeout to kusto azure queue endpoint */
ctx->u->base.net.connect_timeout = ctx->kusto_endpoint_connect_timeout;
ctx->u->base.net.connect_timeout = ctx->kusto_endpoint_connection_timeout;

u_conn = flb_upstream_conn_get(u_node->u);

Expand Down

0 comments on commit c9ab3af

Please sign in to comment.