Skip to content

Commit

Permalink
nlbwmon: fix db cleanup
Browse files Browse the repository at this point in the history
The database will only be cleaned up when the daemon is restarted. With
this change, each refresh of the database checks whether the artifacts
should be cleaned up from the past database. Thus, no more than
configured are kept.

Signed-off-by: Florian Eckert <[email protected]>
  • Loading branch information
feckert committed Mar 2, 2021
1 parent 34a1887 commit 5adf900
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nlbwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,10 @@ handle_refresh(struct uloop_timeout *tm)
err = database_archive(gdbh);

/* database successfully wrapped around and triggered a ct dump */
if (err == -ESTALE)
if (err == -ESTALE) {
database_cleanup();
return;
}

/* fatal error during database archiving */
if (err != 0) {
Expand Down

0 comments on commit 5adf900

Please sign in to comment.