Skip to content

Commit 6ae6258

Browse files
committed
move invoice notification task cancellation to reload
1 parent 750d34f commit 6ae6258

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/pro/cloudnode/smp/bankaccounts/BankAccounts.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,6 @@ public void onEnable() {
107107
@Override
108108
public void onDisable() {
109109
dbSource.close();
110-
if (this.invoiceNotificationTask != null) {
111-
final int taskId = this.invoiceNotificationTask.getTaskId();
112-
getServer().getScheduler().cancelTask(taskId);
113-
this.invoiceNotificationTask = null;
114-
}
115110
}
116111

117112
/**
@@ -169,6 +164,11 @@ public static void reload() {
169164
getInstance().getLogger().warning("Update details: https://modrinth.com/plugin/bankaccounts/version/" + latestVersion);
170165
}));
171166
getInstance().startInterestTimer();
167+
if (getInstance().invoiceNotificationTask != null) {
168+
final int taskId = getInstance().invoiceNotificationTask.getTaskId();
169+
getInstance().getServer().getScheduler().cancelTask(taskId);
170+
getInstance().invoiceNotificationTask = null;
171+
}
172172
getInstance().setupInvoiceNotificationTimer();
173173
}
174174

0 commit comments

Comments
 (0)