Skip to content

Commit 814b0a8

Browse files
committed
improve log output when not using threads on pending processing
1 parent 73afdba commit 814b0a8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/osmdata.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -298,17 +298,19 @@ class multithreaded_processor
298298
{
299299
auto const ids_queued = list.size();
300300

301-
log_info("Going over {} pending {}s (using {} threads)"_format(
302-
ids_queued, type, m_clones.size()));
303-
304301
util::timer_t timer;
305302

306303
if (ids_queued < 100) {
304+
log_info("Going over {} pending {}s"_format(ids_queued, type));
305+
307306
for (auto const oid : list) {
308307
(m_clones[0].get()->*function)(oid);
309308
}
310309
m_clones[0]->sync();
311310
} else {
311+
log_info("Going over {} pending {}s (using {} threads)"_format(
312+
ids_queued, type, m_clones.size()));
313+
312314
std::vector<std::future<void>> workers;
313315

314316
for (auto const &clone : m_clones) {
@@ -330,14 +332,14 @@ class multithreaded_processor
330332
throw;
331333
}
332334
}
335+
336+
if (get_logger().show_progress()) {
337+
fmt::print(stderr, "\rLeft to process: 0.\n");
338+
}
333339
}
334340

335341
timer.stop();
336342

337-
if (get_logger().show_progress()) {
338-
fmt::print(stderr, "\rLeft to process: 0.\n");
339-
}
340-
341343
log_info("Processing {} pending {}s took {} at a rate of {:.2f}/s",
342344
ids_queued, type,
343345
util::human_readable_duration(timer.elapsed()),

0 commit comments

Comments
 (0)