def upsert_voice_channel(self, trans, channel):
values = voice_channel_values(channel)
if self.voice_channel_cache.get(channel.id) == values:
self.logger.debug(f"Voice channel lookup for {channel.id} is already up-to-date")
return
self.logger.debug(f"Updating lookup data for voice channel '{channel.name}'")
ups = p_insert(self.tb_voice_channels) \
.values(values) \
.on_conflict_do_update(
index_elements=['voice_channel_id'],
index_where=(self.tb_voice_channels.c.voice_channel_id == channel.id),
set_=values,
)
trans.execute(ups)
self.voice_channel_cache[channel.id] = values
# Channel Categories
评论列表
文章目录