mirror of
https://github.com/tdlib/telegram-bot-api
synced 2025-08-22 01:49:24 +00:00
Compare commits
4 Commits
ec02990a76
...
16625f70c7
Author | SHA1 | Date | |
---|---|---|---|
|
16625f70c7 | ||
|
cc83909b80 | ||
|
01ee58bd27 | ||
|
e2c834103a |
18
build.html
18
build.html
@ -75,7 +75,7 @@
|
|||||||
a:hover {
|
a:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
select, button {
|
select, button, input {
|
||||||
border: 1px solid var(--color-select-border);
|
border: 1px solid var(--color-select-border);
|
||||||
background-color: var(--background);
|
background-color: var(--background);
|
||||||
color: var(--color);
|
color: var(--color);
|
||||||
@ -266,6 +266,14 @@
|
|||||||
<label><input type="checkbox" id="buildRootCheckbox" onchange="onOptionsChanged()"/>Build from root user (not recommended).</label>
|
<label><input type="checkbox" id="buildRootCheckbox" onchange="onOptionsChanged()"/>Build from root user (not recommended).</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="buildMultiCoreDiv" class="hide">
|
||||||
|
<label><input type="checkbox" id="buildMultiCoreCheckbox" onchange="onOptionsChanged()"/>Build using mulitple cores<span class="hide" id="buildMultiCoreColon">:</span></label>
|
||||||
|
|
||||||
|
<div id="buildMultiCoreInputDiv" class="hide">
|
||||||
|
<input type="number" id="buildMultiCoreInput" onchange="onOptionsChanged()" placeholder="Cores number" min="1" style="text-align: center;"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<p></p>
|
<p></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -354,6 +362,7 @@ function onOptionsChanged() {
|
|||||||
linux_distro = document.getElementById('linuxSelect').value;
|
linux_distro = document.getElementById('linuxSelect').value;
|
||||||
}
|
}
|
||||||
document.getElementById('buildCommandsDiv').style.display = 'block';
|
document.getElementById('buildCommandsDiv').style.display = 'block';
|
||||||
|
document.getElementById('buildMultiCoreDiv').style.display = 'block';
|
||||||
|
|
||||||
var use_clang = os_freebsd || os_openbsd;
|
var use_clang = os_freebsd || os_openbsd;
|
||||||
if (os_linux && linux_distro !== 'Alpine' && !linux_distro.includes('CentOS') && !linux_distro.includes('Fedora')) {
|
if (os_linux && linux_distro !== 'Alpine' && !linux_distro.includes('CentOS') && !linux_distro.includes('Fedora')) {
|
||||||
@ -686,6 +695,11 @@ function onOptionsChanged() {
|
|||||||
commands.push('cd ../build');
|
commands.push('cd ../build');
|
||||||
}
|
}
|
||||||
let build_command = cmake + ' --build . --target install';
|
let build_command = cmake + ' --build . --target install';
|
||||||
|
|
||||||
|
if (document.getElementById('buildMultiCoreCheckbox').checked && document.getElementById('buildMultiCoreInput').value.toString().length > 0 && !(isNaN(document.getElementById('buildMultiCoreInput').value))) {
|
||||||
|
build_command += ` -j ${ document.getElementById('buildMultiCoreInput').value }`;
|
||||||
|
}
|
||||||
|
|
||||||
if (use_msvc) {
|
if (use_msvc) {
|
||||||
if (!is_debug_build) {
|
if (!is_debug_build) {
|
||||||
commands.push(build_command + ' --config Release');
|
commands.push(build_command + ' --config Release');
|
||||||
@ -704,6 +718,8 @@ function onOptionsChanged() {
|
|||||||
if (install_dir !== '/usr/local') {
|
if (install_dir !== '/usr/local') {
|
||||||
install_dir = 'telegram-bot-api';
|
install_dir = 'telegram-bot-api';
|
||||||
}
|
}
|
||||||
|
document.getElementById('buildMultiCoreInputDiv').style.display = document.getElementById('buildMultiCoreCheckbox').checked ? 'block' : 'none';
|
||||||
|
document.getElementById('buildMultiCoreColon').style.display = document.getElementById('buildMultiCoreCheckbox').checked ? 'inline' : 'none';
|
||||||
commands.push((use_powershell ? 'dir ' : 'ls -l ') + install_dir + '/bin/telegram-bot-api*');
|
commands.push((use_powershell ? 'dir ' : 'ls -l ') + install_dir + '/bin/telegram-bot-api*');
|
||||||
document.getElementById('buildCommands').innerHTML = '<ul><li>' + commands.join('</li><li>') + '</li></ul>';
|
document.getElementById('buildCommands').innerHTML = '<ul><li>' + commands.join('</li><li>') + '</li></ul>';
|
||||||
document.getElementById('copyBuildCommandsButton').style.display = commands.includes('exit') ? 'none' : 'block';
|
document.getElementById('copyBuildCommandsButton').style.display = commands.includes('exit') ? 'none' : 'block';
|
||||||
|
@ -6666,7 +6666,7 @@ void Client::check_business_connection_chat_id(const td::string &business_connec
|
|||||||
}
|
}
|
||||||
auto chat_id = r_chat_id.move_as_ok();
|
auto chat_id = r_chat_id.move_as_ok();
|
||||||
check_business_connection(business_connection_id, std::move(query),
|
check_business_connection(business_connection_id, std::move(query),
|
||||||
[this, chat_id, on_success = std::move(on_success)](
|
[chat_id, on_success = std::move(on_success)](
|
||||||
const BusinessConnection *business_connection, PromisedQueryPtr query) mutable {
|
const BusinessConnection *business_connection, PromisedQueryPtr query) mutable {
|
||||||
on_success(business_connection, chat_id, std::move(query));
|
on_success(business_connection, chat_id, std::move(query));
|
||||||
});
|
});
|
||||||
|
@ -23,6 +23,9 @@ ServerCpuStat::ServerCpuStat() {
|
|||||||
void ServerCpuStat::update(double now) {
|
void ServerCpuStat::update(double now) {
|
||||||
auto r_cpu_stat = td::cpu_stat();
|
auto r_cpu_stat = td::cpu_stat();
|
||||||
if (r_cpu_stat.is_error()) {
|
if (r_cpu_stat.is_error()) {
|
||||||
|
if (r_cpu_stat.error().message() != "Not supported") {
|
||||||
|
LOG(ERROR) << "Failed to get CPU statistics: " << r_cpu_stat.error();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user