Skip to content

Commit

Permalink
remove service that updates statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasDev committed Jul 24, 2023
1 parent 80dcb3b commit 43b8b6c
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 363 deletions.
14 changes: 2 additions & 12 deletions src/main/kotlin/no/nav/syfo/Bootstrap.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ import no.nav.syfo.clients.HttpClients
import no.nav.syfo.clients.KafkaConsumers
import no.nav.syfo.clients.KafkaProducers
import no.nav.syfo.db.Database
import no.nav.syfo.elector.LeaderElector
import no.nav.syfo.elector.LeadershipHandling
import no.nav.syfo.oppgave.kafka.OppgaveHendelseConsumer
import no.nav.syfo.oppgave.service.OppgaveService
import no.nav.syfo.oppgave.service.UpdateStatusService
import no.nav.syfo.persistering.MottattSykmeldingService
import no.nav.syfo.service.ManuellOppgaveService
import no.nav.syfo.util.TrackableException
Expand Down Expand Up @@ -109,15 +106,8 @@ fun main() {
createListener(applicationState) {
oppgaveHendelseConsumer.start()
}
val leaderElectorService = LeadershipHandling(
updateService = UpdateStatusService(
database = database,
oppgaveClient = httpClients.oppgaveClient,
),
LeaderElector(httpClient = httpClients.httpClient, env.electorPath),
)
leaderElectorService.start()
ApplicationServer(applicationEngine, applicationState, leaderElectorService).start()

ApplicationServer(applicationEngine, applicationState).start()
}

@DelicateCoroutinesApi
Expand Down
3 changes: 0 additions & 3 deletions src/main/kotlin/no/nav/syfo/application/ApplicationServer.kt
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
package no.nav.syfo.application

import io.ktor.server.engine.ApplicationEngine
import no.nav.syfo.elector.LeadershipHandling
import java.util.concurrent.TimeUnit

class ApplicationServer(
private val applicationServer: ApplicationEngine,
private val applicationState: ApplicationState,
private val leaderElectorService: LeadershipHandling,
) {

init {
Runtime.getRuntime().addShutdownHook(
Thread {
this.applicationState.ready = false
leaderElectorService.stop()
this.applicationServer.stop(TimeUnit.SECONDS.toMillis(10), TimeUnit.SECONDS.toMillis(10))
},
)
Expand Down
35 changes: 0 additions & 35 deletions src/main/kotlin/no/nav/syfo/elector/LeaderElector.kt

This file was deleted.

78 changes: 0 additions & 78 deletions src/main/kotlin/no/nav/syfo/elector/LeadershipHandling.kt

This file was deleted.

92 changes: 0 additions & 92 deletions src/main/kotlin/no/nav/syfo/oppgave/service/UpdateStatusService.kt

This file was deleted.

49 changes: 0 additions & 49 deletions src/test/kotlin/no/nav/syfo/elector/LeadershipHandlingTest.kt

This file was deleted.

This file was deleted.

Loading

0 comments on commit 43b8b6c

Please sign in to comment.