Changeset 19126 in josm
- Timestamp:
- 2024-06-24T09:27:46+02:00 (5 months ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java
r19050 r19126 261 261 getProgressMonitor().subTask( 262 262 trn("Uploading {0} object...", "Uploading {0} objects...", toUpload.getSize(), toUpload.getSize())); 263 getProgressMonitor().setTicks(0); // needed in 2nd and further loop executions 263 264 synchronized (this) { 264 265 writer = new OsmServerWriter(); -
trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java
r19050 r19126 6 6 import static org.openstreetmap.josm.tools.I18n.trn; 7 7 8 import java.time.Instant; 8 9 import java.util.ArrayList; 9 10 import java.util.Collection; … … 19 20 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 20 21 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 22 import org.openstreetmap.josm.io.ChangesetClosedException.Source; 21 23 import org.openstreetmap.josm.tools.CheckParameterUtil; 22 24 … … 156 158 List<OsmPrimitive> chunk = new ArrayList<>(chunkSize); 157 159 Iterator<? extends OsmPrimitive> it = primitives.iterator(); 160 int maxChunkSize = api.getCapabilities().getMaxChangesetSize(); 158 161 int numChunks = (int) Math.ceil((double) primitives.size() / (double) chunkSize); 159 162 int i = 0; … … 163 166 int j = 0; 164 167 chunk.clear(); 165 while (it.hasNext() && j < chunkSize) { 166 if (canceled) return; 168 while (it.hasNext() && j < chunkSize && processed.size() + j < maxChunkSize) { 167 169 j++; 168 170 chunk.add(it.next()); … … 173 175 chunk.size(), i, numChunks, chunk.size())); 174 176 processed.addAll(api.uploadDiff(chunk, progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false))); 177 // see #23738: server will close CS if maximum changeset size was reached 178 if (processed.size() >= maxChunkSize) { 179 throw new ChangesetClosedException(api.getChangeset().getId(), Instant.now(), Source.UPLOAD_DATA); 180 } 175 181 } 176 182 } finally {
Note:
See TracChangeset
for help on using the changeset viewer.