Skip to content

Commit

Permalink
fix(UserRoleSyncer) add config timeout to agent polling (#203)
Browse files Browse the repository at this point in the history
We should wait until after the next poll cycle starts before another instance can try to run.
#203
  • Loading branch information
kevinawoo authored and Travis Tomsu committed Nov 3, 2017
1 parent ac964c1 commit 55b1010
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,19 @@ public class CatsSchedulerConfig {
@Value("${fiat.writeMode.syncDelayMs:600000}")
String syncDelayMs;

@Value("${fiat.writeMode.syncDelayTimeoutMs:30000}")
String syncDelayTimeoutMs;

@Bean
NodeIdentity nodeIdentity() {
return new DefaultNodeIdentity();
}

@Bean
AgentIntervalProvider agentIntervalProvider() {
return new DefaultAgentIntervalProvider(Long.parseLong(syncDelayMs), 10000);
Long pollInterval = Long.parseLong(syncDelayMs);
Long timeout = Long.parseLong(syncDelayTimeoutMs);
return new DefaultAgentIntervalProvider(pollInterval, pollInterval + timeout);
}

@Bean
Expand Down

0 comments on commit 55b1010

Please sign in to comment.