From 7273a6fb327ee33b02bc83f93e00dff1e5f44b1c Mon Sep 17 00:00:00 2001 From: "Ioan v. Pocol" Date: Tue, 8 Jul 2014 09:49:26 +0300 Subject: [PATCH] LB-1863 : Sometimes chained comment is being dublicated three times --- plugins/livedesk-seo/livedesk/core/impl/seo_sync.py | 2 +- plugins/livedesk-sync/livedesk/core/impl/chained_sync.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/livedesk-seo/livedesk/core/impl/seo_sync.py b/plugins/livedesk-seo/livedesk/core/impl/seo_sync.py index 3f3bb2a19..7f3ed91cc 100644 --- a/plugins/livedesk-seo/livedesk/core/impl/seo_sync.py +++ b/plugins/livedesk-seo/livedesk/core/impl/seo_sync.py @@ -122,7 +122,7 @@ def syncSeoBlogs(self): assert isinstance(thread, Thread), 'Invalid thread %s' % thread if thread.is_alive(): continue - if not self.blogSeoService.checkTimeout(blogSeo.Id, self.timeout_inteval * self.sync_interval): continue + if not self.blogSeoService.checkTimeout(blogSeo.Id, self.timeout_inteval * self.sync_interval): continue self.syncThreads[key] = Thread(name='blog %d seo' % blogSeo.Blog, target=self._syncSeoBlog, args=(blogSeo,)) diff --git a/plugins/livedesk-sync/livedesk/core/impl/chained_sync.py b/plugins/livedesk-sync/livedesk/core/impl/chained_sync.py index 32af6ede0..0e7ee7846 100644 --- a/plugins/livedesk-sync/livedesk/core/impl/chained_sync.py +++ b/plugins/livedesk-sync/livedesk/core/impl/chained_sync.py @@ -133,10 +133,11 @@ def syncChains(self): log.info('Chained thread for blog %d is alive', blogSync.Blog) continue - if not self.blogSyncService.checkTimeout(blogSync.Id, self.timeout_inteval * self.sync_interval): - log.info('Chained thread for blog %d is already taken', blogSync.Blog) - continue + if not self.blogSyncService.checkTimeout(blogSync.Id, self.timeout_inteval * self.sync_interval): + log.info('Chained thread for blog %d is already taken', blogSync.Blog) + continue + self.syncThreads[key] = Thread(name='blog %d sync' % blogSync.Blog, target=self._syncChain, args=(blogSync,)) self.syncThreads[key].daemon = True