Fixed /plan m setup false negative on success #681

This commit is contained in:
Rsl1122 2018-08-11 11:35:23 +03:00
parent 8e81560c0e
commit 84ccaabbe4
2 changed files with 12 additions and 1 deletions

View File

@ -12,7 +12,10 @@ import com.djrapitops.plan.system.webserver.response.DefaultResponses;
import com.djrapitops.plan.system.webserver.response.Response;
import com.djrapitops.plan.system.webserver.response.api.BadRequestResponse;
import com.djrapitops.plugin.api.Check;
import com.djrapitops.plugin.api.TimeAmount;
import com.djrapitops.plugin.api.utility.log.Log;
import com.djrapitops.plugin.task.AbsRunnable;
import com.djrapitops.plugin.task.RunnableFactory;
import com.djrapitops.plugin.utilities.Verify;
import java.util.Map;
@ -64,7 +67,12 @@ public class SaveDBSettingsRequest extends InfoRequestWithVariables implements S
Log.info("----------------------------------");
return DefaultResponses.SUCCESS.get();
} finally {
PlanPlugin.getInstance().reloadPlugin(true);
RunnableFactory.createNew("Bungee Setup Restart Task", new AbsRunnable() {
@Override
public void run() {
PlanPlugin.getInstance().reloadPlugin(true);
}
}).runTaskLater(TimeAmount.SECOND.ticks() * 2L);
}
}

View File

@ -56,6 +56,9 @@ public class SendDBSettingsRequest extends InfoRequestWithVariables implements S
if (Check.isBukkitAvailable()) {
return new BadRequestResponse("Not supposed to be called on a Bukkit server");
}
if (Check.isSpongeAvailable()) {
return new BadRequestResponse("Not supposed to be called on a Sponge server");
}
String address = variables.get("address");
Verify.nullCheck(address, () -> new BadRequestException("WebServer Address ('address') not specified in the request."));