<commit_before>package com.mrpowergamerbr.loritta.utils

import com.mrpowergamerbr.loritta.commands.vanilla.administration.MuteCommand
import com.mrpowergamerbr.loritta.dao.Mute
import com.mrpowergamerbr.loritta.network.Databases
import com.mrpowergamerbr.loritta.tables.Mutes
import mu.KotlinLogging
import org.jetbrains.exposed.sql.transactions.transaction

class MutedUsersTask : Runnable {
	companion object {
		private val logger = KotlinLogging.logger {}
	}

	override fun run() {
		logger.info("Verificando usuários temporariamente silenciados... Removal threads ativas: ${MuteCommand.roleRemovalJobs.size}")

		val mutes = transaction(Databases.loritta) {
			Mute.find {
				Mutes.isTemporary eq true
			}
		}

		for (mute in mutes) {
			val guild = lorittaShards.getGuildById(mute.guildId)
			if (guild == null) {
				logger.debug { "Guild \"${mute.guildId}\" não existe ou está indisponível!" }
				continue
			}

			val member = guild.getMemberById(mute.userId) ?: continue

			logger.info("Adicionado removal thread pelo MutedUsersThread ~ Guild: ${mute.guildId} - User: ${mute.userId}")
			MuteCommand.spawnRoleRemovalThread(guild, loritta.getLocaleById("default"), member.user, mute.expiresAt!!)
		}
	}
}<commit_msg>Adicionar try .. catch<commit_after>package com.mrpowergamerbr.loritta.utils

import com.mrpowergamerbr.loritta.commands.vanilla.administration.MuteCommand
import com.mrpowergamerbr.loritta.dao.Mute
import com.mrpowergamerbr.loritta.network.Databases
import com.mrpowergamerbr.loritta.tables.Mutes
import mu.KotlinLogging
import org.jetbrains.exposed.sql.transactions.transaction

class MutedUsersTask : Runnable {
	companion object {
		private val logger = KotlinLogging.logger {}
	}

	override fun run() {
		try {
			logger.info("Verificando usuários temporariamente silenciados... Removal threads ativas: ${MuteCommand.roleRemovalJobs.size}")

			val mutes = transaction(Databases.loritta) {
				Mute.find {
					Mutes.isTemporary eq true
				}
			}

			for (mute in mutes) {
				val guild = lorittaShards.getGuildById(mute.guildId)
				if (guild == null) {
					logger.debug { "Guild \"${mute.guildId}\" não existe ou está indisponível!" }
					continue
				}

				val member = guild.getMemberById(mute.userId) ?: continue

				logger.info("Adicionado removal thread pelo MutedUsersThread ~ Guild: ${mute.guildId} - User: ${mute.userId}")
				MuteCommand.spawnRoleRemovalThread(guild, loritta.getLocaleById("default"), member.user, mute.expiresAt!!)
			}
		} catch (e: Exception) {
			logger.error(e) { "Erro ao verificar removal threads" }
		}
	}
}
{'fraction_non_alphanumeric': 0.11072396438250097, 'fraction_numerical': 0.0, 'mean_word_length': 4.428571428571429, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5451220', 'n_tokens_mistral': 988, 'n_tokens_neox': 883, 'n_words': 166}