Skip to content

nlbwmon: fix db cleanup - #44

Open
feckert wants to merge 1 commit into
jow-:masterfrom
feckert:pr/20210301-fix-db-cleanup
Open

nlbwmon: fix db cleanup#44
feckert wants to merge 1 commit into
jow-:masterfrom
feckert:pr/20210301-fix-db-cleanup

Conversation

@feckert

@feckert feckert commented Mar 1, 2021

Copy link
Copy Markdown

@jow- 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.

This fixes openwrt/packages#14297

@jow-

jow- commented Mar 1, 2021

Copy link
Copy Markdown
Owner

You should only call database_cleanup() if the earlier database_archive() returned -ESTALE, only then there's anything to potentially clean up.

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 <fe@dev.tdt.de>
@feckert
feckert force-pushed the pr/20210301-fix-db-cleanup branch from 5d91e8f to 5adf900 Compare March 2, 2021 11:21
@feckert

feckert commented Apr 20, 2021

Copy link
Copy Markdown
Author

@jow- ping

@schuettecarsten

Copy link
Copy Markdown

@jow- ping... :-)

@romanjokl

Copy link
Copy Markdown

database_archive() can also be called from handle_event(), in which case it will not return -ESTALE in refresh and database_cleanup() get skipped.

I've put database_cleanup() inside database_archive(), see here:
romanjokl@f05a084

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nlbwmon: database files only delete on service restart

4 participants