Skip to content

Commit

Permalink
Change from lazy media storage cleanup to eager
Browse files Browse the repository at this point in the history
Before, if there was any storage location below max use threshold, the
cleanup was skipped. This might cause problem described in
#656 :
as long as one location has space, others might fill up if used by other
processes. The default location, /var/lib/bluecherry/recordings/ is
usually on the system rootfs, where many services' and users' activities
contribute to increasing the filesystem space used.

Now, the media cleanup happens if any of the storage locations is over
the threshold.
  • Loading branch information
andrey-utkin committed Mar 27, 2024
1 parent 800d42f commit 4dd34d5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/bc-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1189,12 +1189,12 @@ static int bc_cleanup_media()
static int bc_check_media(void)
{
int ret = 0;
bool storage_overloaded = true;
bool storage_overloaded = false;

/* If there's some space left, skip cleanup */
for (int i = 0; i < MAX_STOR_LOCS && media_stor[i].max_thresh; i++) {
if (is_storage_full(&media_stor[i]) != 1) {
storage_overloaded = false;
if (is_storage_full(&media_stor[i]) == 1) {
storage_overloaded = true;
break;
}
}
Expand Down

0 comments on commit 4dd34d5

Please sign in to comment.