Skip to content

Commit

Permalink
chore(sql/scheduler): make agent lock release ttl threshold dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
asher committed May 30, 2019
1 parent f365205 commit 2be08a3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class SqlClusteredAgentScheduler(
val newTtl = nextExecutionTime - System.currentTimeMillis()

withPool(POOL_NAME) {
if (newTtl < 500L) {
if (newTtl < dynamicConfigService.getConfig(Long::class.java, "sql.agent.release-threshold-ms", 500)) {
try {
jooq.delete(table(lockTable)).where(field("agent_name").eq(agentType)).execute()
} catch (e: SQLException) {
Expand Down

0 comments on commit 2be08a3

Please sign in to comment.