Skip to content

Commit

Permalink
Support eviction of stale Titus server group keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ajordens authored and tomaslin committed Mar 26, 2018
1 parent 3d7c412 commit 4abd3aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ class Keys {

static String getServerGroupKey(String serverGroupName, String account, String region) {
Names names = Names.parseName(serverGroupName)
"${PROVIDER}:${Namespace.SERVER_GROUPS}:${names.cluster}:${account}:${region}:${names.group}"
return getServerGroupKey(names.cluster, names.group, account, region)
}

static String getServerGroupKey(String cluster, String autoScalingGroupName, String account, String region) {
"${PROVIDER}:${Namespace.SERVER_GROUPS}:${cluster}:${account}:${region}:${autoScalingGroupName}"
}

static String getInstanceKey(String id, String accountId, String stack, String region) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ class TitusClusterCachingAgent implements CachingAgent, CustomScheduledAgent {
types
}

@Override
Optional<Map<String, String>> getCacheKeyPatterns() {
return [
(SERVER_GROUPS.ns): Keys.getServerGroupKey('*', '*', account.name, region)
]
}

static class MutableCacheData implements CacheData {
final String id
int ttlSeconds = -1
Expand Down

0 comments on commit 4abd3aa

Please sign in to comment.