[datafeed] remove remaining uses of 'synchronizing' attribute replaced by 'in_synchronization' in 3.13.8. Closes #1989131 stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 11 Oct 2011 13:54:17 +0200
branchstable
changeset 7933 b25dda2214a2
parent 7932 2ad26cc3b5c6
child 7934 2250a60a7653
child 7935 28fe0b91ad8a
[datafeed] remove remaining uses of 'synchronizing' attribute replaced by 'in_synchronization' in 3.13.8. Closes #1989131
server/sources/datafeed.py
--- a/server/sources/datafeed.py	Tue Oct 11 13:50:32 2011 +0200
+++ b/server/sources/datafeed.py	Tue Oct 11 13:54:17 2011 +0200
@@ -149,10 +149,10 @@
         # XXX race condition until WHERE of SET queries is executed using
         # 'SELECT FOR UPDATE'
         now = datetime.utcnow()
-        if not session.execute('SET X in_synchronizaton %(now)s WHERE X eid %(x)s, X synchronizing NULL OR X synchronizing < %(maxdt)s',
-                               {'x': self.eid,
-                                'now': now,
-                                'maxdt': now - self.max_lock_lifetime}):
+        if not session.execute(
+            'SET X in_synchronization %(now)s WHERE X eid %(x)s, '
+            'X in_synchronization NULL OR X in_synchronization < %(maxdt)s',
+            {'x': self.eid, 'now': now, 'maxdt': now - self.max_lock_lifetime}):
             self.error('concurrent synchronization detected, skip pull')
             session.commit(free_cnxset=False)
             return False
@@ -161,7 +161,7 @@
 
     def release_synchronization_lock(self, session):
         session.set_cnxset()
-        session.execute('SET X synchronizing None WHERE X eid %(x)s',
+        session.execute('SET X in_synchronization NULL WHERE X eid %(x)s',
                         {'x': self.eid})
         session.commit()