mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-07 10:31:51 +00:00
ChunkCache: fixed corner case in cache restart on AsyncTask error
the cache may have been destroyed since the task inception, leading to an exception being thrown.
This commit is contained in:
parent
8943d8a2a7
commit
4aab0565c0
6
src/network/mcpe/cache/ChunkCache.php
vendored
6
src/network/mcpe/cache/ChunkCache.php
vendored
@ -128,10 +128,12 @@ class ChunkCache implements ChunkListener{
|
|||||||
$chunk,
|
$chunk,
|
||||||
$this->caches[$chunkHash],
|
$this->caches[$chunkHash],
|
||||||
$this->compressor,
|
$this->compressor,
|
||||||
function() use ($chunkX, $chunkZ) : void{
|
function() use ($chunkHash, $chunkX, $chunkZ) : void{
|
||||||
$this->world->getLogger()->error("Failed preparing chunk $chunkX $chunkZ, retrying");
|
$this->world->getLogger()->error("Failed preparing chunk $chunkX $chunkZ, retrying");
|
||||||
|
|
||||||
$this->restartPendingRequest($chunkX, $chunkZ);
|
if(isset($this->caches[$chunkHash])){
|
||||||
|
$this->restartPendingRequest($chunkX, $chunkZ);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user