Skip to content

Commit

Permalink
in_blob: fixed already registered file log message
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Alminana <[email protected]>
  • Loading branch information
leonardo-albertovich authored and edsiper committed Oct 21, 2024
1 parent 8f1fd00 commit aadaf1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions plugins/in_blob/blob.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,11 @@ static ssize_t recursive_file_search(struct blob_ctx *ctx,
(uint64_t) fs_entry_metadata.st_ino);
}
else {
/* Result codes :
* 0 - Success
* -1 - Generic failure
* 1 - The file was alrady present in our records
*/
flb_plg_debug(ctx->ins,
"blob scan skip: %s",
glob_context.gl_pathv[index]);
Expand Down
4 changes: 2 additions & 2 deletions plugins/in_blob/blob_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ int blob_file_append(struct blob_ctx *ctx, char *path, struct stat *st)
bfile = cfl_list_entry(head, struct blob_file, _head);
if (strcmp(bfile->path, path) == 0) {
/* file already exists */
return -1;
return 1;
}
}

#ifdef FLB_HAVE_SQLDB
if (ctx->database_file) {
/* the file was already registered, just skipt it */
if (blob_db_file_exists(ctx, path, &id_found) == FLB_TRUE) {
return 0;
return 1;
}
}
#endif
Expand Down

0 comments on commit aadaf1c

Please sign in to comment.