Skip to content

Commit

Permalink
out_azure_kusto:updated exit 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 Jan 10, 2025
1 parent 16dc582 commit d49357f
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions plugins/out_azure_kusto/azure_kusto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1614,12 +1614,16 @@ static int cb_azure_kusto_exit(void *data, struct flb_config *config)
return -1;
}

if (azure_kusto_store_has_data(ctx) == FLB_TRUE) {
flb_plg_info(ctx->ins, "Sending all locally buffered data to Kusto");
ret = ingest_all_chunks(ctx, config);
if (ret < 0) {
flb_plg_error(ctx->ins, "Could not send all chunks on exit");

if (ctx->buffering_enabled == FLB_TRUE){
if (azure_kusto_store_has_data(ctx) == FLB_TRUE) {
flb_plg_info(ctx->ins, "Sending all locally buffered data to Kusto");
ret = ingest_all_chunks(ctx, config);
if (ret < 0) {
flb_plg_error(ctx->ins, "Could not send all chunks on exit");
}
}
azure_kusto_store_exit(ctx);
}

if (ctx->u) {
Expand All @@ -1638,8 +1642,6 @@ static int cb_azure_kusto_exit(void *data, struct flb_config *config)
pthread_mutex_destroy(&ctx->token_mutex);
pthread_mutex_destroy(&ctx->blob_mutex);

azure_kusto_store_exit(ctx);

flb_azure_kusto_conf_destroy(ctx);

return 0;
Expand Down

0 comments on commit d49357f

Please sign in to comment.