Commit 8e419d71 authored by Sebastien Robin's avatar Sebastien Robin

better management of first synchronization


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@647 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2e63d174
...@@ -53,6 +53,11 @@ class PublicationSynchronization(XMLSyncUtils): ...@@ -53,6 +53,11 @@ class PublicationSynchronization(XMLSyncUtils):
alert = self.checkAlert(xml_client) alert = self.checkAlert(xml_client)
alert_code = self.getAlertCode(xml_client) alert_code = self.getAlertCode(xml_client)
# If slow sync, then resend everything
if alert_code == self.SLOW_SYNC:
LOG('Warning !!!, reseting client synchronization for subscriber:',0,subscriber)
subscriber.resetAllSignatures()
# Check if the last time synchronization is the same as the client one # Check if the last time synchronization is the same as the client one
if subscriber.getNextAnchor() != last_anchor: if subscriber.getNextAnchor() != last_anchor:
if last_anchor == None: if last_anchor == None:
...@@ -136,6 +141,7 @@ class PublicationSynchronization(XMLSyncUtils): ...@@ -136,6 +141,7 @@ class PublicationSynchronization(XMLSyncUtils):
# first synchronization # first synchronization
result = self.PubSyncInit(self.getPublication(id),xml_client,subscriber=subscriber,sync_type=self.SLOW_SYNC) result = self.PubSyncInit(self.getPublication(id),xml_client,subscriber=subscriber,sync_type=self.SLOW_SYNC)
elif self.checkAlert(xml_client) and alert_code in (self.TWO_WAY,self.SLOW_SYNC): elif self.checkAlert(xml_client) and alert_code in (self.TWO_WAY,self.SLOW_SYNC):
result = self.PubSyncInit(publication=self.getPublication(id), result = self.PubSyncInit(publication=self.getPublication(id),
xml_client=xml_client, subscriber=subscriber,sync_type=alert_code) xml_client=xml_client, subscriber=subscriber,sync_type=alert_code)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment