@@ -32,9 +32,7 @@ Function UploadCrashDumpsDaily()
32
32
return NaN
33
33
endif
34
34
35
- if ( UploadCrashDumps ())
36
- printf "Crash dumps have been successfully uploaded.\r "
37
- endif
35
+ UploadCrashDumps ()
38
36
39
37
JSON_SetString ( jsonID, "/diagnostics/last upload" , GetIso8601TimeStamp ())
40
38
AbortOnRTE
@@ -142,7 +140,7 @@ static Function UploadPing()
142
140
143
141
jsonID = GenerateJSONTemplateForUpload ()
144
142
AddPayloadEntries ( jsonID, { UPLOAD_BLOCK_USERPING} , { payload} , isBinary = 0 )
145
- UploadJSONPayload ( jsonID)
143
+ UploadJSONPayloadAsync ( jsonID)
146
144
147
145
return err
148
146
End
175
173
/// The uploaded files are moved out of the way afterwards.
176
174
///
177
175
/// See `tools/ http- upload/ upload- json- payload- v1. php` for the JSON format description.
178
- ///
179
- /// @return 1 if crash dumps had been uploaded, 0 otherwise
180
176
Function UploadCrashDumps ()
181
177
182
178
string diagSymbPath, basePath, diagPath
@@ -192,12 +188,9 @@ Function UploadCrashDumps()
192
188
numLogs = DimSize ( logs, ROWS)
193
189
194
190
if ( ! numFiles && ! numLogs)
195
- return 0
191
+ return NaN
196
192
endif
197
193
198
- printf "Please wait while we upload %d crash dumps. This might take a while.\r " , numFiles + numLogs
199
- ControlWindowToFront ()
200
-
201
194
jsonID = GenerateJSONTemplateForUpload ()
202
195
203
196
AddPayloadEntriesFromFiles ( jsonID, files, isBinary = 1 )
@@ -213,15 +206,16 @@ Function UploadCrashDumps()
213
206
SaveTextFile ( JSON_dump ( jsonID, indent = 4 ) , diagPath + ":" + UniqueFileOrFolder ( basePath, "crash-dumps" , suffix = ".json" ))
214
207
#endif // DEBUGGING_ENABLED
215
208
216
- UploadJSONPayload ( jsonID)
209
+ UploadJSONPayloadAsync ( jsonID)
217
210
218
211
#ifndef DEBUGGING_ENABLED
219
212
MoveFolder / P=$ basePath "Diagnostics" as UniqueFileOrFolder ( basePath, "Diagnostics_old" )
220
213
#endif // DEBUGGING_ENABLED
221
214
222
215
DEBUGPRINT_ELAPSED ( referenceTime)
223
216
224
- return 1
217
+ printf "Uploading %d crash dumps is in progress in the background.\r " , numFiles + numLogs
218
+ ControlWindowToFront ()
225
219
End
226
220
227
221
/// @brief Upload the MIES and ZeroMQ logfiles
@@ -234,7 +228,7 @@ Function UploadLogFiles([variable verbose, variable firstDate, variable lastDate
234
228
235
229
string logPartStr, fNamePart, file, ticket, timeStamp
236
230
string path, location, basePath, out
237
- variable ret , jsonID, numFiles, i , j, doFilter, isBinary, lastIndex, jsonIndex, partCnt, sumSize, fSize
231
+ variable jsonID, numFiles, i , j, doFilter, isBinary, lastIndex, jsonIndex, partCnt, sumSize, fSize
238
232
239
233
isBinary = 1
240
234
verbose = ParamIsDefault ( verbose) ? 1 : !! verbose
@@ -334,22 +328,14 @@ Function UploadLogFiles([variable verbose, variable firstDate, variable lastDate
334
328
sprintf out, "Uploading %.0f MB (~%d Bytes)" , sumSize / MEGABYTE, sumSize
335
329
UploadLogFilesPrint ( out, verbose)
336
330
for ( jsonID : jsonIDs)
337
- ret = UploadJSONPayload ( jsonID)
338
-
339
- if ( ret)
340
- sprintf out, "Error uploading the logfiles.\r "
341
- UploadLogFilesPrint ( out, verbose)
342
- Make / FREE/ N= ( DimSize ( jsonIDs, ROWS)) junk = JSON_Release ( jsonIDs[ p] , ignoreErr = 1 )
343
- return NaN
344
- endif
331
+ UploadJSONPayloadAsync ( jsonID)
345
332
346
333
UploadLogFilesPrint ( "." , verbose)
347
334
endfor
348
335
UploadLogFilesPrint ( "\r " , verbose)
349
336
endif
350
- UploadLogFilesPrint ( "Done.\r " , verbose)
351
337
352
- sprintf out, "Successfully uploaded the MIES, ZeroMQ-XOP and ITCXOP2 logfiles. Please mention your ticket \" %s\" if you are contacting support.\r " , ticket
338
+ sprintf out, "Uploading the MIES, ZeroMQ-XOP and ITCXOP2 logfiles is in progress in the background . Please mention your ticket \" %s\" if you are contacting support.\r " , ticket
353
339
UploadLogFilesPrint ( out, verbose)
354
340
End
355
341
0 commit comments