From 95984169321a9bcb1fd99b8ae1864cbe97aa4577 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Mon, 4 Jan 2021 18:23:45 +0000 Subject: [PATCH] handle cancellation properly in DefaultProgressSubscriber --- .../core/queue/subscriber/DefaultProgressSubscriber.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/main/java/com/plotsquared/core/queue/subscriber/DefaultProgressSubscriber.java b/Core/src/main/java/com/plotsquared/core/queue/subscriber/DefaultProgressSubscriber.java index b9f5cf80e..6197fb22a 100644 --- a/Core/src/main/java/com/plotsquared/core/queue/subscriber/DefaultProgressSubscriber.java +++ b/Core/src/main/java/com/plotsquared/core/queue/subscriber/DefaultProgressSubscriber.java @@ -27,7 +27,6 @@ package com.plotsquared.core.queue.subscriber; import com.google.common.base.Preconditions; import com.google.common.util.concurrent.AtomicDouble; -import com.google.inject.Inject; import com.google.inject.assistedinject.Assisted; import com.google.inject.assistedinject.AssistedInject; import com.plotsquared.core.configuration.Settings; @@ -105,6 +104,7 @@ public class DefaultProgressSubscriber implements ProgressSubscriber { } if (cancelled.get()) { task.cancel(); + return; } actor.sendMessage(caption, Template.of("progress", String.format("%.2f", this.progress.doubleValue() * 100))); }, interval), wait);