Skip to content

Commit

Permalink
Fix bans with duration unbanning immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed Jan 9, 2024
1 parent f851a1b commit 4802dca
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public interface PendingUnbansDAO extends Transactional<PendingUnbansDAO> {
* @param guild the guild in which to unban the users
* @return a list of user IDs to unban
*/
@SqlQuery("select user from pending_unbans where guild = :guild and deadline < datetime()")
@SqlQuery("select user from pending_unbans where guild = :guild and deadline <= unixepoch() * 1000")
List<Long> getUsersToUnban(@Bind("guild") long guild);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void registerCommands(CommandClientBuilder builder) {
@Override
public void setup(JDA jda) {
final McVerificationDAO dao = Database.main().onDemand(McVerificationDAO.class);
BotMain.EXECUTOR.scheduleAtFixedRate(() -> banNotVerified(jda, dao), 0, 1, TimeUnit.MINUTES);
BotMain.EXECUTOR.scheduleAtFixedRate(() -> banNotVerified(jda, dao), 1, 1, TimeUnit.MINUTES);
}

private void banNotVerified(JDA jda, McVerificationDAO db) {
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/net/neoforged/camelot/util/MailService.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package net.neoforged.camelot.util;

import com.google.common.base.Suppliers;
import j2html.tags.Tag;
import j2html.tags.specialized.HtmlTag;
import jakarta.mail.Authenticator;
import jakarta.mail.Message;
import jakarta.mail.MessagingException;
Expand All @@ -17,12 +15,6 @@

import java.util.Properties;
import java.util.function.Consumer;
import java.util.function.Supplier;

import static j2html.TagCreator.body;
import static j2html.TagCreator.h1;
import static j2html.TagCreator.html;
import static j2html.TagCreator.pre;

public class MailService {
private final Session session;
Expand Down

0 comments on commit 4802dca

Please sign in to comment.