Skip to content

Commit

Permalink
Remove wrapping transaction for single read api (#2560)
Browse files Browse the repository at this point in the history
  • Loading branch information
LZRS committed Jun 7, 2024
1 parent 6d3a5d3 commit 8a6f720
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,10 @@ internal class DatabaseImpl(
}

override suspend fun select(type: ResourceType, id: String): Resource {
return db.withTransaction {
resourceDao.getResource(resourceId = id, resourceType = type)?.let {
iParser.parseResource(it)
}
?: throw ResourceNotFoundException(type.name, id)
} as Resource
return resourceDao.getResource(resourceId = id, resourceType = type)?.let {
iParser.parseResource(it) as Resource
}
?: throw ResourceNotFoundException(type.name, id)
}

override suspend fun insertSyncedResources(resources: List<Resource>) {
Expand Down

0 comments on commit 8a6f720

Please sign in to comment.