Logging bugfix

This commit is contained in:
Daniil Gentili 2018-12-27 17:16:49 +01:00
parent 73f5bec68f
commit e5582beb87
2 changed files with 8 additions and 6 deletions

2
docs

@ -1 +1 @@
Subproject commit 0fcff8e5a31af300511949c4dbafc7be6c0d4dd7
Subproject commit 82b301b00560298776ce9ca852e8db71ac21b2e9

View File

@ -39,6 +39,9 @@ trait Files
$cb = $file;
$file = $file->getFile();
}
$t = microtime(true);
$file = \danog\MadelineProto\Absolute::absolute($file);
if (!file_exists($file)) {
throw new \danog\MadelineProto\Exception(\danog\MadelineProto\Lang::$current_lang['file_not_exist']);
@ -127,17 +130,16 @@ trait Files
}
fclose($f);
clearstatcache();
$this->logger->logger('Speed: '.((filesize($file) * 8) / (microtime(true) - $t) / 1000000));
return $constructor;
}
public function upload($file, $file_name = '', $cb = null, $encrypted = false, $datacenter = null)
{
$t = microtime(true);
$res = $this->wait(call([$this, 'upload_async'], $file, $file_name, $cb, $encrypted, $datacenter));
$this->logger->logger('Speed: '.((filesize($file) * 8) / (microtime(true) - $t) / 1000000));
return $res;
return $this->wait(call([$this, 'upload_async'], $file, $file_name, $cb, $encrypted, $datacenter));
}
public function upload_encrypted($file, $file_name = '', $cb = null)