mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 17:59:41 +00:00
Fixed #2599
This commit is contained in:
parent
21e0739845
commit
5f4f996efe
@ -194,9 +194,6 @@ class MainLogger extends \AttachableThreadedLogger{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->logStream .= date("Y-m-d", $now) . " " . $cleanMessage;
|
$this->logStream .= date("Y-m-d", $now) . " " . $cleanMessage;
|
||||||
$this->synchronized(function(){
|
|
||||||
$this->notify();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function run(){
|
public function run(){
|
||||||
@ -207,18 +204,14 @@ class MainLogger extends \AttachableThreadedLogger{
|
|||||||
}
|
}
|
||||||
|
|
||||||
while($this->shutdown === false){
|
while($this->shutdown === false){
|
||||||
if($this->logStream !== ""){
|
if(strlen($this->logStream) > 0){
|
||||||
$this->synchronized(function(){
|
$this->lock();
|
||||||
$this->lock();
|
$chunk = $this->logStream;
|
||||||
$chunk = $this->logStream;
|
$this->logStream = "";
|
||||||
$this->logStream = "";
|
$this->unlock();
|
||||||
$this->unlock();
|
fwrite($this->logResource, $chunk);
|
||||||
fwrite($this->logResource, $chunk);
|
|
||||||
});
|
|
||||||
}else{
|
}else{
|
||||||
$this->synchronized(function(){
|
usleep(250000);
|
||||||
$this->wait(250000);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user