KamilH
04/28/2022, 5:03 AMkoin-annotation
project? I have a following declaration in my `Module`:
@Singleton
fun allPlayersCache(): Cache<Unit, List<Player>> =
ExpirableCache(LocalDateTimeCacheValidator())
@Singleton
fun allPlayersByTourCache(): Cache<Season, List<TeamPlayer>> =
ExpirableCache(LocalDateTimeCacheValidator())
but it doesn’t work because it gets generated like that:
single(qualifier=null) { moduleInstance.allPlayersCache() }
single(qualifier=null) { moduleInstance.allPlayersByTourCache() }
and it reports a following error:
Caused by: org.koin.core.error.DefinitionOverrideException: Already existing definition for [Singleton:'com.kamilh.utils.cache.Cache'] at com.kamilh.utils.cache.Cache::_root_
I guess in a classic koin I would need to use named
right? It seems like it’s not available in koin-annotation
arnaud.giuliani
04/28/2022, 7:14 AM