From f1278425bcc521b13c4dceae2b0c58a503052d98 Mon Sep 17 00:00:00 2001 From: Bierque Jason Date: Thu, 16 Dec 2021 04:23:30 +0100 Subject: [PATCH] Convert Database Async If the database is too heavy, the main thread dies and does not convert correctly. --- src/main/java/com/gamingmesh/jobs/commands/list/convert.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/convert.java b/src/main/java/com/gamingmesh/jobs/commands/list/convert.java index 9291e82e..6e1a4b0e 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/convert.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/convert.java @@ -1,5 +1,6 @@ package com.gamingmesh.jobs.commands.list; +import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -21,7 +22,7 @@ public class convert implements Cmd { return true; } - Jobs.convertDatabase(); + Bukkit.getScheduler().runTaskAsynchronously(plugin, Jobs::convertDatabase); String from = "MySQL"; String to = "SQLite";