diff --git a/boards/models/source.py b/boards/models/source.py --- a/boards/models/source.py +++ b/boards/models/source.py @@ -41,8 +41,9 @@ class ThreadSource(models.Model): if self.thread.is_archived(): logger.error('The thread {} is archived, please try another one'.format(self.thread)) else: - start_timestamp = timezone.localtime(self.timestamp) + start_timestamp = self.timestamp last_timestamp = start_timestamp + logger.info('Start timestamp is {}'.format(start_timestamp)) if self.thread.is_bumplimit(): logger.warn('The thread {} has reached its bumplimit, please create a new one'.format(self.thread)) if self.source_type == SOURCE_TYPE_RSS: @@ -56,11 +57,11 @@ class ThreadSource(models.Model): else: if timestamp > last_timestamp: last_timestamp = timestamp - if timestamp > start_timestamp: Post.objects.create_post(title=title, text=item.description, thread=self.thread, file_urls=[item.link]) logger.info('Fetched item {} from {} into thread {}'.format( title, self.name, self.thread)) + logger.info('New timestamp is {}'.format(last_timestamp)) self.timestamp = last_timestamp self.save(update_fields=['timestamp'])