Browse Source

Topic metadata generator: skip deleted topics

Not really a big deal, but deleted topics are getting sent back through
this consumer when the clean_private_data script erases their data,
since that changes the markdown and puts them into the topic.edited
queue. There shouldn't be any reason to process deleted topics and
re-add "blank" metadata (0 word count, no excerpt), so we can just skip
them.
merge-requests/37/head
Deimos 6 years ago
parent
commit
85cf709d6f
  1. 3
      tildes/consumers/topic_metadata_generator.py

3
tildes/consumers/topic_metadata_generator.py

@ -33,6 +33,9 @@ class TopicMetadataGenerator(PgsqlQueueConsumer):
self.db_session.query(Topic).filter_by(topic_id=msg.body["topic_id"]).one()
)
if topic.is_deleted:
return
if topic.is_text_type:
new_metadata = self._generate_text_metadata(topic)
elif topic.is_link_type:

Loading…
Cancel
Save