Skip to content

Commit d8d592a

Browse files
committed
Update ProgressReport2.aspx
1 parent c3d581b commit d8d592a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

source code/TestDebugASPNET/pages/ProgressReport2.aspx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@
191191
let urlApi = "/apiProgressReport2";
192192
let intervalTimer = null;
193193
let networkErrorCount = 0;
194+
let api_call_index = 0;
194195
195196
async function startBackup() {
196197
@@ -292,9 +293,13 @@
292293
293294
async function getStatus() {
294295
try {
296+
// increment the api call index
297+
api_call_index++;
298+
295299
const formData = new FormData();
296300
formData.append("action", "get_status");
297301
formData.append("taskid", currentTaskId);
302+
formData.append("api_call_index", api_call_index);
298303
299304
const result = await fetch(urlApi, {
300305
method: "POST",
@@ -304,6 +309,12 @@
304309
305310
if (result.ok) {
306311
let jsonObject = await result.json();
312+
313+
if (jsonObject.api_call_index != api_call_index) {
314+
// late echo, ignore
315+
return;
316+
}
317+
307318
updateUiValues(jsonObject);
308319
}
309320
else {

0 commit comments

Comments
 (0)