]> git.hungrycats.org Git - bees/commitdiff
context: add a PROGRESS: header in $BEESSTATUS
authorZygo Blaxell <bees@furryterror.org>
Sun, 1 Dec 2024 16:32:36 +0000 (11:32 -0500)
committerZygo Blaxell <bees@furryterror.org>
Sun, 1 Dec 2024 16:41:59 +0000 (11:41 -0500)
Make it clearer where the progress information goes.

Also add placeholder text so the progress section isn't empty at startup,
when the progress hasn't been calculated yet.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
src/bees-context.cc

index dd46c7cfbe031acfb28d450748bf920cfca0d6d5..d9901c89583d7f02298779a2bf0f4ded554427f6 100644 (file)
@@ -98,6 +98,7 @@ BeesContext::dump_status()
                TaskMaster::print_queue(ofs);
 #endif
 
+               ofs << "PROGRESS:\n";
                ofs << get_progress();
 
                ofs.close();
@@ -125,6 +126,9 @@ string
 BeesContext::get_progress()
 {
        unique_lock<mutex> lock(m_progress_mtx);
+       if (m_progress_str.empty()) {
+               return "[No progess estimate available]\n";
+       }
        return m_progress_str;
 }