Skip to content

Commit a1faa4f

Browse files
cosmo0920edsiper
authored andcommitted
engine: Handle zero size as no limit
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent a8bffb2 commit a1faa4f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/flb_engine.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ static inline int handle_input_event(flb_pipefd_t fd, uint64_t ts,
209209

210210
static inline double calculate_chunk_capacity_percent(struct flb_output_instance *ins)
211211
{
212-
if (ins->total_limit_size == -1) {
212+
/* Currently, total_limit_size 0(K|M)B will be translated as no
213+
* limit. So, we need to handle this situation to be unlimited. */
214+
if (ins->total_limit_size <= 0) {
213215
return 100.0;
214216
}
215217

0 commit comments

Comments
 (0)