Skip to content

Commit

Permalink
Adjust cooldown checks slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCodez committed Sep 7, 2023
1 parent ad62da3 commit 56e9705
Showing 1 changed file with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,14 @@ public void checkPerSite(UUID uuid) {
}

public void vote(VotingPluginUser user, VoteSite site) {
timer.schedule(new Runnable() {

@Override
public void run() {
if (cooldownCheckEnabled) {
schedule(user);
}

if (plugin.getConfigFile().isPerSiteCoolDownEvents()) {
user.setCoolDownCheckSite(site, Boolean.FALSE);
schedulePerSite(user);
}
}
}, 10, TimeUnit.SECONDS);
if (cooldownCheckEnabled) {
schedule(user);
}

if (plugin.getConfigFile().isPerSiteCoolDownEvents()) {
user.setCoolDownCheckSite(site, Boolean.FALSE);
schedulePerSite(user);
}
}

public synchronized void check(VotingPluginUser user) {
Expand Down Expand Up @@ -159,7 +152,7 @@ public void run() {
check(uuid);
}
}
}, time + 2, TimeUnit.SECONDS);
}, time + 60, TimeUnit.SECONDS);
allSiteTasks.put(uuid, scheduledFuture);
}

Expand Down

0 comments on commit 56e9705

Please sign in to comment.