I'm trying to get result from WorkManager in suspend function by this way
suspend fun uploadLogs(filePath: String): String {
val request = createRequest(createInputLogsData(filePath))
workManager.enqueue(request).await()
val url = workManager.getWorkInfoById(request.id).await().outputData.getString(KEY_URL)
return url
}
But looks like await() function didn't work. After call await() state of request is still ENQUEUED.
I need get result synchronously from WorkManager in this coroutine context.
Maybe I doing something wrong?