File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -5,21 +5,20 @@ export class StatisticsLogger{
55 log ( info , token ) {
66 let logString = "" ;
77 Object . keys ( info ) . forEach ( k => logString += info [ k ] + "," ) ;
8- this . send ( logString , token ) ;
8+ this . send ( logString , token , 0 ) ;
99 }
1010
11- send ( logString , token ) {
11+ send ( logString , token , retryCount ) {
1212 let xhr = createXHR ( ) ;
13- let count = 0 ;
1413 let self = this ;
1514 xhr . open ( "POST" , "https://uplog.qbox.me/log/3" ) ;
1615 xhr . setRequestHeader ( "Content-type" , "application/x-www-form-urlencoded" ) ;
1716 xhr . setRequestHeader ( "Authorization" , "UpToken " + token ) ;
1817 xhr . onreadystatechange = function ( ) {
1918 if ( xhr . readyState === 4 ) {
2019 if ( xhr . status !== 200 ) {
21- count ++ ;
22- count <= 3 ? self . send ( logString , token ) : "" ;
20+ retryCount ++ ;
21+ retryCount <= 3 ? self . send ( logString , token , retryCount ) : "" ;
2322 }
2423 }
2524 } ;
Original file line number Diff line number Diff line change @@ -275,7 +275,7 @@ export class UploadManager {
275275 this . onData ( this . progress ) ;
276276 }
277277
278- finishDirectProgress ( ) {
278+ finishDirectProgress ( ) {
279279 // 在某些浏览器环境下,xhr 的 progress 事件无法被触发,progress 为 null, 这里 fake 下
280280 if ( ! this . progress ) {
281281 this . progress = { total : this . getProgressInfoItem ( this . file . size , this . file . size ) } ;
You can’t perform that action at this time.
0 commit comments