carb::crashreporter::sendAndRemoveLeftOverDumpsAsync

Defined in carb/crashreporter/CrashReporterUtils.h

inline std::future<void> carb::crashreporter::sendAndRemoveLeftOverDumpsAsync()

Attempts to upload any crash dump files left by a previously crashed process.

Remark

This starts off the process of checking for and uploading old crash dump files that may have been left over by a previous crashed process. This situation can occur if the upload failed in the previous process (ie: network connection issue, etc), or the process crashed again during the upload. A list of old crash dump files will be searched for in the currently set dump directory (as set by /crashreporter/dumpDir). If any are found, they will be uploaded one by one to the currently set upload URL (/crashreporter/url). Each crash dump file will be uploaded with its original metadata if the matching metadata file can be found. Once a file has been successfully uploaded to the given upload URL, it will be deleted from local storage unless the /crashreporter/preserveDump setting is true. This entire process will be skipped if the /crashreporter/skipOldDumpUpload setting is true and this call will simply return immediately.

Thread Safety

This function is thread safe. If multiple calls are made while an upload is still in progress, a new task will just be added to the upload queue instead of starting off another upload thread.

Note

If an upload is in progress when the process tries to exit or the crash reporter plugin tries to unload, any remaining uploads will be cancelled, but the current upload operation will wait to complete. If this is a large file being uploaded or the internet connection’s upload speed is particularly slow, this could potentially take a long time. There is unfortunately no reliable way to cancel this upload in progress currently.

Returns

A future that can be used to check on the completion of the upload operation. The operation is fully asynchronous and will proceed on its own. The future object will be signaled once the operation completes, successfully or otherwise.