Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gpeal committed Apr 1, 2024
1 parent 1179993 commit 8f464cd
Showing 1 changed file with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import okhttp3.Call
import okhttp3.Callback
import okhttp3.Credentials
import okhttp3.MediaType.Companion.toMediaType
Expand Down Expand Up @@ -175,17 +176,15 @@ class HappoSnapshotter(
}

private suspend fun OkHttpClient.executeDeferred(request: Request): Response = suspendCoroutine { continuation ->
newCall(request).enqueue(
object : Callback {
override fun onFailure(call: okhttp3.Call, e: IOException) {
continuation.resumeWithException(e)
}

override fun onResponse(call: okhttp3.Call, response: Response) {
continuation.resume(response)
}
},
)
newCall(request).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
continuation.resumeWithException(e)
}

override fun onResponse(call: Call, response: Response) {
continuation.resume(response)
}
})
}

private val ByteArray.md5: String
Expand Down

0 comments on commit 8f464cd

Please sign in to comment.