Fix condition for triggering new unique report event (#422)

This commit is contained in:
Cheick Keita 2021-01-12 11:00:34 -08:00 committed by GitHub
parent 70d41d1cc5
commit 2e2ba988ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,10 +69,11 @@ async fn upload_deduped(report: &CrashReport, container: &BlobContainerUrl) -> R
.put(deduped_url)
.json(report)
// Conditional PUT, only if-not-exists.
// https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations
.header("If-None-Match", "*")
.send_retry_default()
.await?;
if result.status() != StatusCode::NOT_MODIFIED {
if result.status() == StatusCode::CREATED {
event!(new_unique_report;);
}
Ok(())