Cleanup Thread (like .update)
Commit Message
I demand that Klaus Schmidinger may or may not have written...
> hgm.bg wrote:
>> Is there a possibility to implement the same way .update works a way to
>> start the cleanup thread which is deleting the deleted recordings ? I'm
>> usually low an diskspace and when try to free space for new recordings it
>> takes mostly more than 5 minutes of an idle VDR to delete the recordings
>> on the system. Sometimes 5 minutes is too long :) [...]
I find that it often takes too long too...
> recording.c:
> #define REMOVECHECKDELTA 3600 // seconds between checks for removing deleted files
Experimental patch (compile-tested only) attached. It adjusts the removal
check scheduling so that removal occurs at (by default) 6 minutes after
deletion. There is a 1-minute minimum delay, and the delay is reset every
time a recording is marked for deletion.
This also gives you enough time to unmark a recording, either by renaming it
manually or by using an undelete plugin.
Comments
vdr-bounces@linuxtv.org wrote:
>> #define REMOVECHECKDELTA 3600 // seconds between checks for removing
>> deleted files
>
> Experimental patch (compile-tested only) attached. It adjusts the
> removal check scheduling so that removal occurs at (by default) 6
> minutes after deletion. There is a 1-minute minimum delay, and the
> delay is reset every time a recording is marked for deletion.
>
> This also gives you enough time to unmark a recording, either by
> renaming it manually or by using an undelete plugin.
Okay, i will try this, thx
/hgm.bg
@@ -61,10 +61,10 @@
bool VfatFileSystem = false;
static cRecordings DeletedRecordings(true);
+static time_t LastRemoveCheck = 0;
void RemoveDeletedRecordings(void)
{
- static time_t LastRemoveCheck = 0;
if (LastRemoveCheck == 0) {
DeletedRecordings.Update();
LastRemoveCheck = time(NULL) - REMOVECHECKDELTA * 9 / 10;
@@ -718,6 +718,7 @@
}
isyslog("deleting recording %s", FileName());
result = RenameVideoFile(FileName(), NewName);
+ LastRemoveCheck = time(NULL) - max (60, REMOVECHECKDELTA * 9 / 10);
}
free(NewName);
return result;