AW: Cleanup Thread (like .update)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I demand that hgm.bg may or may not have written...

> vdr-bounces@xxxxxxxxxxx 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

It turns out that that one contained a stupid bug - it'd default to 54
minutes, not six. See attached.

(BTW, fix your subject prefix or we'll get long "Re: AW:" strings...)

Klaus: are you deliberately using > rather than >= in the removal time checks
in RemoveDeletedRecordings()?

-- 
| Darren Salt | d youmustbejoking,demon,co,uk | nr. Ashington,
| Debian,     | s zap,tartarus,org            | Northumberland
| RISC OS     | @                             | Toon Army
|   <URL:http://www.youmustbejoking.demon.co.uk/> (PGP 2.6, GPG keys)

He who believes the past cannot be changed has not yet written his memoirs.
-------------- next part --------------
--- vdr-1.3.34~/recording.c
+++ vdr-1.3.34/recording.c
@@ -62,10 +62,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;
@@ -743,6 +743,7 @@
         }
      isyslog("deleting recording %s", FileName());
      result = RenameVideoFile(FileName(), NewName);
+     LastRemoveCheck = time(NULL) - REMOVECHECKDELTA + max (60, REMOVECHECKDELTA / 10);
      }
   free(NewName);
   return result;

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux