mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-20 06:00:44 +00:00
Add method to let some lower-level actions try to generically update counts, but not to go lower than original counts were.
This commit is contained in:
@ -95,6 +95,23 @@ public class AsyncJobCallback
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Update the current and total fields, but ONLY if the new values are
|
||||
** both >= the previous values.
|
||||
*******************************************************************************/
|
||||
public void updateStatusOnlyUpwards(int current, int total)
|
||||
{
|
||||
boolean currentIsOkay = (this.asyncJobStatus.getCurrent() == null || this.asyncJobStatus.getCurrent() <= current);
|
||||
boolean totalIsOkay = (this.asyncJobStatus.getTotal() == null || this.asyncJobStatus.getTotal() <= total);
|
||||
|
||||
if(currentIsOkay && totalIsOkay)
|
||||
{
|
||||
updateStatus(current, total);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Increase the 'current' value in the '1 of 2' sense.
|
||||
*******************************************************************************/
|
||||
|
Reference in New Issue
Block a user