mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 06:57:36 -06:00
ENH:periodic request full push
when the printer does not push any data packets, request data from the printer at intervals Change-Id: I4c84586301588f6a14f65d7a732d22f57bce59c9
This commit is contained in:
parent
18a5575bbc
commit
7ffeb1a432
2 changed files with 7 additions and 2 deletions
|
@ -4350,11 +4350,16 @@ void DeviceManager::keep_alive()
|
|||
obj->keep_alive_count++;
|
||||
std::chrono::system_clock::time_point start = std::chrono::system_clock::now();
|
||||
auto internal = std::chrono::duration_cast<std::chrono::milliseconds>(start - obj->last_keep_alive);
|
||||
if (internal.count() > TIMEOUT_FOR_KEEPALIVE && internal.count() < 1000 * 60 * 60 * 300) {
|
||||
if (internal.count() > TIMEOUT_FOR_KEEPALIVE && (internal.count() < 1000 * 60 * 60 * 300) ) {
|
||||
BOOST_LOG_TRIVIAL(info) << "keep alive = " << internal.count() << ", count = " << obj->keep_alive_count;
|
||||
obj->command_request_push_all();
|
||||
obj->last_keep_alive = start;
|
||||
}
|
||||
else if(obj->m_push_count == 0){
|
||||
BOOST_LOG_TRIVIAL(info) << "keep alive = " << internal.count() << ", push_count = 0, count = " << obj->keep_alive_count;
|
||||
obj->command_request_push_all();
|
||||
obj->last_keep_alive = start;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue