Skip to content

Commit

Permalink
- Fixes as per @aaime review
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessio Fabiani committed Sep 21, 2018
1 parent b7da171 commit 4bee008
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.geoserver.wps.executor.ProcessStatusTracker;
import org.geotools.data.Query;
import org.geotools.factory.CommonFactoryFinder;
import org.geotools.filter.SortByImpl;
import org.geotools.util.logging.Logging;
import org.opengis.filter.Filter;
import org.opengis.filter.FilterFactory2;
Expand Down Expand Up @@ -186,13 +185,11 @@ protected List<ExecutionStatus> getFilteredItems() {

SortBy sortOrder = null;
if (sort != null) {
SortBy[] sortBys = new SortByImpl[1];
final Property<?> property = getProperty(sort);
if (property.isSearchable()) { // we really need another flag
final String sortProperty = ((BeanProperty<StoreInfo>) property).getPropertyPath();
sortOrder = sortBy(sortProperty, sort.isAscending());
sortBys[0] = sortOrder;
query.setSortBy(sortBys);
query.setSortBy(new SortBy[] {sortOrder});
}
}
LOGGER.fine("built query " + query + " to filter statuses");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ public void fireProgress(float progress, String task) {
// By default we estimate the completion as:
// "time elapsed millis / percentage completed"
if (progress > 0) {
long timeEalpsedMillis =
long timeElapsedMillis =
(new Date().getTime() - status.getCreationTime().getTime());
int estimatedCompletionMillis =
(int)
((timeEalpsedMillis / progress) * timeEalpsedMillis
+ timeEalpsedMillis);
((timeElapsedMillis / progress) * timeElapsedMillis
+ timeElapsedMillis);
Calendar calendar = Calendar.getInstance();
calendar.setTime(status.getCreationTime());
calendar.add(Calendar.MILLISECOND, estimatedCompletionMillis);
Expand Down

0 comments on commit 4bee008

Please sign in to comment.