Skip to content
This repository has been archived by the owner on Jul 27, 2019. It is now read-only.

Commit

Permalink
Change command queue synchronous.
Browse files Browse the repository at this point in the history
  • Loading branch information
cnaude committed Feb 16, 2014
1 parent 9522288 commit 8d1a62f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/com/cnaude/purpleirc/CommandQueueWatcher.java
Expand Up @@ -3,7 +3,6 @@
import com.cnaude.purpleirc.Events.IRCCommandEvent;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import org.bukkit.scheduler.BukkitTask;

/**
*
Expand All @@ -12,7 +11,7 @@
public class CommandQueueWatcher {

private final PurpleIRC plugin;
private BukkitTask bt;
private int bt;
private final Queue<IRCCommand> queue = new ConcurrentLinkedQueue<IRCCommand>();

/**
Expand All @@ -26,7 +25,7 @@ public CommandQueueWatcher(final PurpleIRC plugin) {

private void startWatcher() {
plugin.logDebug("Starting command queue");
bt = this.plugin.getServer().getScheduler().runTaskTimer(this.plugin, new Runnable() {
bt = this.plugin.getServer().getScheduler().scheduleSyncRepeatingTask(this.plugin, new Runnable() {
@Override
public void run() {
queueAndSend();
Expand All @@ -46,7 +45,7 @@ private void queueAndSend() {
*
*/
public void cancel() {
bt.cancel();
this.plugin.getServer().getScheduler().cancelTask(bt);
}

public String clearQueue() {
Expand Down

0 comments on commit 8d1a62f

Please sign in to comment.