Some time ago I made the following patch for DBCachePlugins WebDB? .pm cause some DBD archivists had trouble with the cache file.

I forgot about the patch and never used it in a production environment. Maybe somebody else finds it useful.

Index: WebDB.pm
===================================================================
--- WebDB.pm    (Revision 10299)
+++ WebDB.pm    (Arbeitskopie)
@@ -75,8 +75,18 @@
 # WARNING: this breaks on Archivists that are not file-based
 sub _getCacheFile {
   my $this = shift;
+  my $retries = 0;
 
   my $cacheFile = $this->{archivist}->{_file};
+
+  # on some BDB Archivists the above returns undef sometimes
+  my $maxRetries = $Foswiki::cfg{DBCache}{MaxRetries} || 5;
+  while ( (not defined $cacheFile) && ($retries <= $maxRetries) ) {
+    $retries++;
+    sleep(0.5);
+    $cacheFile = $this->{archivist}->{_file};
+  }
+
   writeDebug("cacheFile=$cacheFile");
   return $cacheFile if -f $cacheFile;
 

-- OliverKrueger - 31 Jan 2011

 

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads