def upsert_channel_category(self, trans, category):
values = channel_categories_values(category)
if self.channel_cache.get(category.id) == values:
self.logger.debug(f"Channel category lookup for {category.id} is already up-to-date")
return
self.logger.debug(f"Updating lookup data for channel category {category.name}")
ups = p_insert(self.tb_channel_categories) \
.values(values) \
.on_conflict_do_update(
index_elements=['category_id'],
index_where=(self.tb_channel_categories.c.category_id == category.id),
set_=values,
)
trans.execute(ups)
self.channel_category_cache[category.id] = values
# Users
评论列表
文章目录