Commit f2b15311 by Masaru Abe

閲覧ログ送信 1件でも送信失敗した場合PC側にバッファされている全ての閲覧ログが残り再送信され続ける問題修正

parent ba5c1c73
......@@ -2551,11 +2551,23 @@ function RegisterLog() {
pageLog: pageLogJson,
objectLog: objectLogJson
};
//API送信結果判定
arrContentLogs[nIndex].sendResult = false;
avwCmsApiSync(ClientData.userInfo_accountPath(), "contentReadingLog", 'post', params,
null,
function (data) {
if (data.result == 'success') {
//成功したログは削除
arrContentLogs[nIndex].sendResult = true;
}
},
function (xhr, b, c) {
if (xhr.status != 0) {
isError = true;
var xhrData = JSON.parse(xhr.responseText);
if ( xhrData && xhrData.httpStatus == 500 ) {
//なんらか不正なデータなので送信成功にして捨てる
arrContentLogs[nIndex].sendResult = true;
}
}
else {
showSystemError();
......@@ -2568,6 +2580,15 @@ function RegisterLog() {
// Clear logs in local
if (!isError) {
ClientData.ContentLogData([]);
} else {
//送信成功したログは削除
var arrTarget = [];
for (var nIndex = 0; nIndex < arrContentLogs.length; nIndex++) {
if( arrContentLogs[nIndex].sendResult == false ){
arrTarget.push(arrContentLogs[nIndex]);
}
}
ClientData.ContentLogData(arrTarget);
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment