Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Purge Threshold #256

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

ChrisLeinbach
Copy link

@ChrisLeinbach ChrisLeinbach commented Dec 13, 2024

Problem

Currently, the threshold at which files are purged from disk is hard coded at 95%. Depending on users and systems this can be either too high or too low. Editing the threshold to adjust for user preferences would have to be done in the script where the disk cleanup is run. This is less than ideal because it puts this control out of scope for less technical users and would be wiped out or cause issues during updates.

Proposed Change

Add a purge threshold setting. This setting allows the user to control at what filled percentage the purge activities are run.

Detailed Description of Changes

  1. Adds a configuration item to advanced.php to set the purge threshold. Also adds relevant description and warnings.

    • The current setting allow a range of 20-99 percent. These felt sensible to me but I'm open to changing them.
    • Note: The purge threshold is still active when the user has set Keep mode. This does present a risk that a user will set a low threshold while in keep mode and the services will be shut down sooner than they expect. This may warrant a more advanced implementation if it is felt that this is a sufficiently large risk.
  2. Adds a snippet to update_birdnet_snippets.sh to set the default purge threshold. The default matches the threshold that was previously hardcoded.

  3. Changes the space equivalence check in disk_check.sh to use the newly defined purge threshold.

  4. Adds the purge threshold to install_config.sh

Adds a purge threshold setting. This setting allows the user to
control at what filled percentage the purge activities are run.
This replaces the default, hard coded 95% point.

The purge threshold defaults at the original 95%. I set a minimum
of 20 and max of 99 because those values felt sensible but am open
to changing those based on feedback.

Note: The purge threshold is still active when the keep option is
set. I added a note for this but this still presents some risk
where users who change this while in Keep mode could have their
services shut down earlier than they expect.
Adds a purge threshold setting. This setting allows the user to
control at what filled percentage the purge activities are run.
This replaces the default, hard coded 95% point.

The purge threshold defaults at the original 95%. I set a minimum
of 20 and max of 99 because those values felt sensible but am open
to changing those based on feedback.

Note: The purge threshold is still active when the keep option is
set. I added a note for this but this still presents some risk
where users who change this while in Keep mode could have their
services shut down earlier than they expect.

Patch: Fix a couple of typos in initial changes and improve
formatting.
@alexbelgium
Copy link

Hi, indeed looks useful for people who want to avoid being at limit of their disks ; or who share their system with data storage with another app

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.

2 participants