kurt_steiner
02/02/2024, 5:17 AMsingle {
TaskService(
database = get(),
taskGroupService = get(),
taskProjectService = get(),
tagService = get(),
subtaskService = get()
)
}
single {
TaskGroupService(
database = get(),
taskService = get()
)
}
how can I fix it ?Nino
02/02/2024, 9:14 AMTaskService
needs TaskGroupService
, which in turns needs TaskService
, which in turn needs TaskGroupService
, etc...
Try to extract the code that is needed by both your classes into a 3rd "standalone" class, which can be injected without issue in both TaskService
and TaskGroupService
kurt_steiner
02/02/2024, 10:26 AMNino
02/02/2024, 10:28 AMTaskGroupService
still has the TaskService
dependency, the issue (cyclic dependency) is still present, even if you avoided the crash by injecting lazily the TaskGroupService
.Nino
02/02/2024, 10:30 AMPedro Francisco de Sousa Neto
02/02/2024, 2:33 PM