-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Working on removing the DatabaseManager usage within the securi…
…ty API
- Loading branch information
1 parent
ad43c3e
commit 2d292bf
Showing
22 changed files
with
297 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
cam/src/main/kotlin/org/dreamexposure/discal/cam/business/cronjob/SessionCronJob.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.dreamexposure.discal.cam.business.cronjob | ||
|
||
import kotlinx.coroutines.reactor.mono | ||
import org.dreamexposure.discal.core.business.SessionService | ||
import org.dreamexposure.discal.core.logger.LOGGER | ||
import org.dreamexposure.discal.core.utils.GlobalVal | ||
import org.springframework.boot.ApplicationArguments | ||
import org.springframework.boot.ApplicationRunner | ||
import org.springframework.stereotype.Component | ||
import reactor.core.publisher.Flux | ||
import reactor.core.publisher.Mono | ||
import java.time.Duration | ||
|
||
@Component | ||
class SessionCronJob( | ||
val sessionService: SessionService, | ||
) : ApplicationRunner { | ||
override fun run(args: ApplicationArguments?) { | ||
Flux.interval(Duration.ofHours(1)) | ||
.flatMap { justDoIt() }.doOnError { | ||
LOGGER.error(GlobalVal.DEFAULT, "Session cronjob error", it) | ||
}.onErrorResume { | ||
Mono.empty() | ||
}.subscribe() | ||
} | ||
|
||
private fun justDoIt() = mono { | ||
LOGGER.debug("Running expired session purge job") | ||
|
||
sessionService.deleteExpiredSessions() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 0 additions & 120 deletions
120
cam/src/main/kotlin/org/dreamexposure/discal/cam/google/GoogleInternalAuthHandler.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.