@@ -104,22 +104,24 @@ module.exports.create = async (type = "auto", retried = false) => {
104
104
if ( process . env . PREVIEW_MODE === "true" ) {
105
105
await new Promise ( resolve => setTimeout ( resolve , 5000 ) ) ;
106
106
test = {
107
- ping : { latency : Math . floor ( Math . random ( ) * 250 ) + 5 } ,
107
+ ping : { latency : Math . floor ( Math . random ( ) * 25 ) + 5 } ,
108
108
download : { bytes : Math . floor ( Math . random ( ) * 1000000000 ) + 1000000 , elapsed : 10000 } ,
109
109
upload : { bytes : Math . floor ( Math . random ( ) * 1000000000 ) + 1000000 , elapsed : 10000 }
110
110
}
111
111
} else {
112
112
test = await this . run ( retried ) ;
113
113
}
114
114
115
- let { ping, download, upload, time} = await parseData . parseData ( mode , test ) ;
115
+ let { ping, download, upload, time} = await parseData . parseData ( process . env . PREVIEW_MODE === "true" ?
116
+ "ookla" : mode , test ) ;
116
117
117
118
let testResult = await tests . create ( ping , download , upload , time , test . serverId , type ) ;
118
119
console . log ( `Test #${ testResult } was executed successfully in ${ time } s. 🏓 ${ ping } ⬇ ${ download } ️ ⬆ ${ upload } ️` ) ;
119
120
createRecommendations ( ) . then ( ( ) => "" ) ;
120
121
setRunning ( false ) ;
121
122
sendFinished ( { ping, download, upload, time} ) . then ( ( ) => "" ) ;
122
123
} catch ( e ) {
124
+ console . log ( e )
123
125
if ( ! retried ) return this . create ( type , true ) ;
124
126
let testResult = await tests . create ( - 1 , - 1 , - 1 , null , 0 , type , e . message ) ;
125
127
await sendError ( e . message ) ;
0 commit comments