[Bps-public-commit] r16229 - in Pushmi/trunk: Pushmi-Admin/lib/Pushmi/Admin

alexmv at bestpractical.com alexmv at bestpractical.com
Mon Oct 6 18:41:29 EDT 2008


Author: alexmv
Date: Mon Oct  6 18:41:28 2008
New Revision: 16229

Modified:
   Pushmi/trunk/   (props changed)
   Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Watcher.pm

Log:
 r37991 at kohr-ah:  chmrr | 2008-10-06 18:41:23 -0400
  * Auto-sync if the replica is too far behind


Modified: Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Watcher.pm
==============================================================================
--- Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Watcher.pm	(original)
+++ Pushmi/trunk/Pushmi-Admin/lib/Pushmi/Admin/Watcher.pm	Mon Oct  6 18:41:28 2008
@@ -47,6 +47,14 @@
                 { id => $id }
             )->publish;
         }
+        # Sync if we're more than 10 revisions, or 5 minutes, behind
+        if ($replica->status eq "behind"
+            and (  $replica->remote_revision - $replica->local_revision >= 10
+                or (time - $replica->cache->{remote_date} > 5*60 ))
+            )
+        {
+            $replica->sync;
+        }
         $short = $replica->status;
         $previous = $replica->long_status;
         $pool->clear;



More information about the Bps-public-commit mailing list