mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-17 08:54:22 +00:00
Merge branch 'release/3.4'
This commit is contained in:
commit
1c9137aa94
@ -226,7 +226,6 @@ class AsyncPool{
|
|||||||
if($task->isCrashed()){
|
if($task->isCrashed()){
|
||||||
$this->logger->critical("Could not execute asynchronous task " . (new \ReflectionClass($task))->getShortName() . ": Task crashed");
|
$this->logger->critical("Could not execute asynchronous task " . (new \ReflectionClass($task))->getShortName() . ": Task crashed");
|
||||||
}elseif(!$task->hasCancelledRun()){
|
}elseif(!$task->hasCancelledRun()){
|
||||||
try{
|
|
||||||
/*
|
/*
|
||||||
* It's possible for a task to submit a progress update and then finish before the progress
|
* It's possible for a task to submit a progress update and then finish before the progress
|
||||||
* update is detected by the parent thread, so here we consume any missed updates.
|
* update is detected by the parent thread, so here we consume any missed updates.
|
||||||
@ -238,10 +237,6 @@ class AsyncPool{
|
|||||||
*/
|
*/
|
||||||
$task->checkProgressUpdates();
|
$task->checkProgressUpdates();
|
||||||
$task->onCompletion();
|
$task->onCompletion();
|
||||||
}catch(\Throwable $e){
|
|
||||||
$this->logger->critical("Could not execute completion of asynchronous task " . (new \ReflectionClass($task))->getShortName() . ": " . $e->getMessage());
|
|
||||||
$this->logger->logException($e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
break; //current task is still running, skip to next worker
|
break; //current task is still running, skip to next worker
|
||||||
|
@ -44,10 +44,6 @@ class FileWriteTask extends AsyncTask{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function onRun() : void{
|
public function onRun() : void{
|
||||||
try{
|
|
||||||
file_put_contents($this->path, $this->contents, $this->flags);
|
file_put_contents($this->path, $this->contents, $this->flags);
|
||||||
}catch(\Throwable $e){
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -147,13 +147,9 @@ class SendUsageTask extends AsyncTask{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function onRun() : void{
|
public function onRun() : void{
|
||||||
try{
|
|
||||||
Internet::postURL($this->endpoint, $this->data, 5, [
|
Internet::postURL($this->endpoint, $this->data, 5, [
|
||||||
"Content-Type: application/json",
|
"Content-Type: application/json",
|
||||||
"Content-Length: " . strlen($this->data)
|
"Content-Length: " . strlen($this->data)
|
||||||
]);
|
]);
|
||||||
}catch(\Throwable $e){
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user