updated log
This commit is contained in:
parent
f56ca75e7e
commit
c31e7a0995
@ -87,15 +87,16 @@ static void check_server(const server_cfg &server, data_db &state_db) {
|
||||
|
||||
auto data = state_db.get(download_id);
|
||||
const auto update_entry = [&download_id, &now, &size_left, &state_db,
|
||||
&title, url = server.url]() {
|
||||
&title,
|
||||
url = server.url](auto last_size_left) {
|
||||
if (size_left == 0U) {
|
||||
state_db.remove(download_id);
|
||||
return;
|
||||
}
|
||||
|
||||
utils::error::handle_info(
|
||||
function_name, fmt::format("updating {}|{}|{}|{}", download_id,
|
||||
title, now, size_left));
|
||||
function_name, fmt::format("updating {}|{}|{}|{}|{}", download_id,
|
||||
title, now, size_left, last_size_left));
|
||||
state_db.set(data_entry{
|
||||
download_id,
|
||||
now,
|
||||
@ -112,13 +113,13 @@ static void check_server(const server_cfg &server, data_db &state_db) {
|
||||
} else if (size_left == 0U || not is_downloading) {
|
||||
state_db.remove(download_id);
|
||||
} else {
|
||||
update_entry();
|
||||
update_entry(data->size_left);
|
||||
}
|
||||
} else if (size_left == 0U || not is_downloading) {
|
||||
state_db.remove(download_id);
|
||||
}
|
||||
} else if (is_downloading && size_left > 0U) {
|
||||
update_entry();
|
||||
update_entry(0U);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user