Always run LoadPlayerImages task in the thread pool.

Prevents the main thread being blocked if the mysql connection is lost etc, when fetchskins is disabled.
This commit is contained in:
James Lyne 2021-10-01 13:44:29 +01:00
parent c59daae676
commit 404bc34e5f

View File

@ -301,10 +301,7 @@ public class PlayerFaces {
@Override @Override
public void playerEvent(DynmapPlayer p) { public void playerEvent(DynmapPlayer p) {
Runnable job = new LoadPlayerImages(p.getName(), p.getSkinURL(), p.getUUID(), core.skinUrlProvider); Runnable job = new LoadPlayerImages(p.getName(), p.getSkinURL(), p.getUUID(), core.skinUrlProvider);
if(fetchskins)
MapManager.scheduleDelayedJob(job, 0); MapManager.scheduleDelayedJob(job, 0);
else
job.run();
} }
}); });
storage = core.getDefaultMapStorage(); storage = core.getDefaultMapStorage();