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->synchronized(function(){
|
||||
$this->notify();
|
||||
});
|
||||
}
|
||||
|
||||
public function run(){
|
||||
@ -207,18 +204,14 @@ class MainLogger extends \AttachableThreadedLogger{
|
||||
}
|
||||
|
||||
while($this->shutdown === false){
|
||||
if($this->logStream !== ""){
|
||||
$this->synchronized(function(){
|
||||
$this->lock();
|
||||
$chunk = $this->logStream;
|
||||
$this->logStream = "";
|
||||
$this->unlock();
|
||||
fwrite($this->logResource, $chunk);
|
||||
});
|
||||
if(strlen($this->logStream) > 0){
|
||||
$this->lock();
|
||||
$chunk = $this->logStream;
|
||||
$this->logStream = "";
|
||||
$this->unlock();
|
||||
fwrite($this->logResource, $chunk);
|
||||
}else{
|
||||
$this->synchronized(function(){
|
||||
$this->wait(250000);
|
||||
});
|
||||
usleep(250000);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user