Skip to content

Commit

Permalink
Go back to string ETA to reduce updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoffland committed Jul 31, 2024
1 parent 88692f3 commit df6c32c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/fah/client/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ double Unit::getEstimatedProgress() const {
// Get estimated progress since last update from core
double delta = getRunTime() - lastKnownProgressUpdateRunTime;
double runtime = getRunTimeEstimate();
double deltaProgress = runtime ? delta / runtime : 0;
double deltaProgress = (0 < delta && 0 < runtime) ? delta / runtime : 0;
if (0.01 < deltaProgress) deltaProgress = 0.01; // No more than 1%

double progress = getKnownProgress() + deltaProgress;
Expand Down Expand Up @@ -837,10 +837,10 @@ void Unit::monitorRun() {
readViewerData();

// Update ETA, PPD and progress
uint64_t eta = getETA();
uint64_t ppd = getPPD();
if (eta != getU64("eta", 0)) insert("eta", eta);
if (ppd != getU64("ppd", -1)) insert("ppd", ppd);
auto eta = TimeInterval(getETA(), true).toString();
auto ppd = getPPD();
if (eta != getString("eta", "")) insert("eta", eta);
if (ppd != getU64("ppd", -1)) insert("ppd", ppd);
setProgress(getEstimatedProgress(), 1);
} CATCH_ERROR;

Expand Down

0 comments on commit df6c32c

Please sign in to comment.