Skip to content

Commit 30eb89e

Browse files
Leonardo Alminanaedsiper
authored andcommitted
out_azure_blob: fixed blob endpoint tracking
Signed-off-by: Leonardo Alminana <[email protected]>
1 parent cbfc240 commit 30eb89e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

plugins/out_azure_blob/azure_blob.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,8 @@ static int process_blob_chunk(struct flb_azure_blob *ctx, struct flb_event_chunk
668668
continue;
669669
}
670670

671-
ret = azb_db_file_insert(ctx, source, ctx->endpoint, file_path, file_size);
671+
ret = azb_db_file_insert(ctx, source, ctx->real_endpoint, file_path, file_size);
672+
672673
if (ret == -1) {
673674
flb_plg_error(ctx->ins, "cannot insert blob file into database: %s (size=%lu)",
674675
file_path, file_size);
@@ -893,10 +894,13 @@ static void cb_azb_blob_file_upload(struct flb_config *config, void *out_context
893894
/* just continue, the row info was retrieved */
894895
}
895896

896-
if (strcmp(file_destination, ctx->endpoint) != 0) {
897+
898+
if (strcmp(file_destination, ctx->real_endpoint) != 0) {
897899
flb_plg_info(ctx->ins,
898-
"endpoint change detected, restarting file : %s",
899-
file_path);
900+
"endpoint change detected, restarting file : %s\n%s\n%s",
901+
file_path,
902+
file_destination,
903+
ctx->real_endpoint);
900904

901905
info->active_upload = FLB_FALSE;
902906

plugins/out_azure_blob/azure_blob_db.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ int azb_db_file_part_get_next(struct flb_azure_blob *ctx,
751751
*part_delivery_attempts = sqlite3_column_int64(ctx->stmt_get_next_file_part, 5);
752752
tmp = (char *) sqlite3_column_text(ctx->stmt_get_next_file_part, 6);
753753
*file_delivery_attempts = sqlite3_column_int64(ctx->stmt_get_next_file_part, 7);
754-
tmp_destination = (char *) sqlite3_column_text(ctx->stmt_get_next_file_part, 8);
754+
tmp_destination = (char *) sqlite3_column_text(ctx->stmt_get_next_file_part, 9);
755755
}
756756
else if (ret == SQLITE_DONE) {
757757
/* no records */

0 commit comments

Comments
 (0)