[Erp5-report] r17107 - /erp5/trunk/products/ERP5SyncML/PublicationSynchronization.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Oct 23 09:55:04 CEST 2007


Author: nicolas
Date: Tue Oct 23 09:55:03 2007
New Revision: 17107

URL: http://svn.erp5.org?rev=17107&view=rev
Log:
Move part of Code, to avoid reset publication twice

Modified:
    erp5/trunk/products/ERP5SyncML/PublicationSynchronization.py

Modified: erp5/trunk/products/ERP5SyncML/PublicationSynchronization.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/PublicationSynchronization.py?rev=17107&r1=17106&r2=17107&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/PublicationSynchronization.py (original)
+++ erp5/trunk/products/ERP5SyncML/PublicationSynchronization.py Tue Oct 23 09:55:03 2007
@@ -76,29 +76,6 @@
       # to those of the publication :
       subscriber.setSourceURI(self.getTargetURI(xml_client))
       subscriber.setTargetURI(self.getSourceURI(xml_client))
-
-      # If slow sync, then resend everything
-      if alert_code == self.SLOW_SYNC and \
-         subscriber.getNextAnchor() != self.NULL_ANCHOR:
-        LOG('Warning !!!, reseting client synchronization for subscriber:', WARNING,
-            subscriber.getPath())
-        subscriber.resetAllSignatures()
-        subscriber.resetAnchors()
-
-      # Check if the last time synchronization is the same as the client one
-      if subscriber.getNextAnchor() != last_anchor:
-        if last_anchor in (None, ''):
-          LOG('PubSyncInit', INFO, 'anchor null')
-        else:
-          mess = '\nsubscriber.getNextAnchor:\t%s\nsubscriber.getLastAnchor:\t%s\
-                 \nlast_anchor:\t\t\t%s\nnext_anchor:\t\t\t%s' % \
-                 (subscriber.getNextAnchor(),
-                  subscriber.getLastAnchor(),
-                  last_anchor,
-                  next_anchor)
-          LOG('PubSyncInit Anchors', INFO, mess)
-      else:
-        subscriber.setNextAnchor(next_anchor)
 
       xml_list = []
       xml = xml_list.append
@@ -133,6 +110,28 @@
                                       subscription=subscriber).values()
         xml(xml_status)
       else:
+        # If slow sync, then resend everything
+        if alert_code == self.SLOW_SYNC and \
+          subscriber.getNextAnchor() != self.NULL_ANCHOR:
+          LOG('Warning !!!, reseting client synchronization for subscriber:', WARNING,
+              subscriber.getPath())
+          subscriber.resetAllSignatures()
+          subscriber.resetAnchors()
+  
+        # Check if the last time synchronization is the same as the client one
+        if subscriber.getNextAnchor() != last_anchor:
+          if last_anchor in (None, ''):
+            LOG('PubSyncInit', INFO, 'anchor null')
+          else:
+            mess = '\nsubscriber.getNextAnchor:\t%s\nsubscriber.getLastAnchor:\t%s\
+                  \nlast_anchor:\t\t\t%s\nnext_anchor:\t\t\t%s' % \
+                  (subscriber.getNextAnchor(),
+                    subscriber.getLastAnchor(),
+                    last_anchor,
+                    next_anchor)
+            LOG('PubSyncInit Anchors', INFO, mess)
+        else:
+          subscriber.setNextAnchor(next_anchor)
         (authentication_format, authentication_type, data) = \
             self.getCred(xml_client)
         if authentication_type == publication.getAuthenticationType():




More information about the Erp5-report mailing list