Skip to content

Commit

Permalink
fix: Catch error in flag poller for local evaluation (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
tyiuhc authored Oct 10, 2023
1 parent b28edf4 commit 5084ed2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/kotlin/flag/FlagConfigService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,19 @@ internal class FlagConfigServiceImpl(

override fun start() {
lock.once {
refresh()
poller.scheduleAtFixedRate(
{ refresh() },
{
try {
refresh()
} catch (e: Exception) {
Logger.e("Failed to refresh flag configs.", e)
}
},
config.flagConfigPollerIntervalMillis,
config.flagConfigPollerIntervalMillis,
TimeUnit.MILLISECONDS
)
refresh()
}
}

Expand Down

0 comments on commit 5084ed2

Please sign in to comment.