Tweakable part size
This commit is contained in:
parent
b4835f595f
commit
52e670d7a5
@ -56,7 +56,7 @@ class MTProto
|
|||||||
/*
|
/*
|
||||||
const V = 71;
|
const V = 71;
|
||||||
*/
|
*/
|
||||||
const V = 104;
|
const V = 105;
|
||||||
const NOT_LOGGED_IN = 0;
|
const NOT_LOGGED_IN = 0;
|
||||||
const WAITING_CODE = 1;
|
const WAITING_CODE = 1;
|
||||||
const WAITING_SIGNUP = -1;
|
const WAITING_SIGNUP = -1;
|
||||||
@ -524,6 +524,9 @@ class MTProto
|
|||||||
'handler_workers' => 10,
|
'handler_workers' => 10,
|
||||||
], 'upload' => [
|
], 'upload' => [
|
||||||
'allow_automatic_upload' => true,
|
'allow_automatic_upload' => true,
|
||||||
|
'part_size' => 512*1024,
|
||||||
|
], 'download' => [
|
||||||
|
'part_size' => 1024*1024,
|
||||||
], 'pwr' => [
|
], 'pwr' => [
|
||||||
'pwr' => false,
|
'pwr' => false,
|
||||||
// Need info ?
|
// Need info ?
|
||||||
|
@ -44,7 +44,7 @@ trait Files
|
|||||||
$this->logger->logger('Upload status: '.$percent.'%', \danog\MadelineProto\Logger::NOTICE);
|
$this->logger->logger('Upload status: '.$percent.'%', \danog\MadelineProto\Logger::NOTICE);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
$part_size = 512 * 1024;
|
$part_size = $this->settings['upload']['part_size'];
|
||||||
$part_total_num = (int) ceil($file_size / $part_size);
|
$part_total_num = (int) ceil($file_size / $part_size);
|
||||||
$part_num = 0;
|
$part_num = 0;
|
||||||
$method = $file_size > 10 * 1024 * 1024 ? 'upload.saveBigFilePart' : 'upload.saveFilePart';
|
$method = $file_size > 10 * 1024 * 1024 ? 'upload.saveBigFilePart' : 'upload.saveFilePart';
|
||||||
@ -370,7 +370,7 @@ trait Files
|
|||||||
$end = $message_media['size'];
|
$end = $message_media['size'];
|
||||||
}
|
}
|
||||||
$size = $end - $offset;
|
$size = $end - $offset;
|
||||||
$part_size = 1024 * 1024;
|
$part_size = $this->settings['download']['part_size'];
|
||||||
$percent = 0;
|
$percent = 0;
|
||||||
$datacenter = isset($message_media['InputFileLocation']['dc_id']) ? $message_media['InputFileLocation']['dc_id'] : $this->datacenter->curdc;
|
$datacenter = isset($message_media['InputFileLocation']['dc_id']) ? $message_media['InputFileLocation']['dc_id'] : $this->datacenter->curdc;
|
||||||
if (isset($message_media['key'])) {
|
if (isset($message_media['key'])) {
|
||||||
|
Loading…
Reference in New Issue
Block a user