Aa policy cache#226
Conversation
bf01d66 to
a5f03a0
Compare
|
Nitpick but please configure your agents on commit message subject lengths - you are again overflowing |
| if (!namesToStatuses.isEmpty()) { | ||
| verify(archiverService, times(1)).getStatusesViaGet(anyString(), anyList()); | ||
| verify(archiverService).getStatusesViaGet(anyString(), anyList()); | ||
| verify(archiverService).getStatusesViaPost(anyString(), anyList()); |
There was a problem hiding this comment.
This change should be split out. It is a fix in what should be a no-op refactor commit. And the conventional commit category here (for the refactor) should prob be refactor(tests) rather than test(...).
There was a problem hiding this comment.
Not sure exactly what you mean.
There was a problem hiding this comment.
Commit message for e299354 is categorised as refactor. But the commit message body says add missing post verification (it was even more explicit before). Adding something missing is IMO not refactor but fix. The commit appears to contain 1 refactor 1 fix and should thus be split.
| "PostSupportArchivers", | ||
| postSupportArchivers.toString(), | ||
| "PolicyRefreshIntervalSeconds", | ||
| String.valueOf(policyRefreshIntervalSeconds), |
There was a problem hiding this comment.
These names should be improved, esp the first one (latter just add Cache somewhere)
There was a problem hiding this comment.
Tried to make more consistent.
There was a problem hiding this comment.
I still think PostSupportArchivers could be improved
remove duplicate stubs, add missing post verification Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Policies are fetched once at startup (@PostConstruct) and refreshed on a configurable fixed delay (aa.policy_refresh_interval_seconds, default 1 h) rather than on every process() call. process() now reads a volatile snapshot, so policy fetches can no longer block or fail mid-run. processorInfo() exposes LastPolicyRefresh and per-archiver policy counts for observability. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Create a base class AAChannelProcessorBaseIT with shared fields (archiveProperty, activeProperty, inactiveProperty), @MockitoBean/@Autowired declarations, @beforeeach primeCache(), and the paramableAAChannelProcessorTest helper. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Make a method cachedPoliciesRepresentation to make printing of cachedPolicies more DRY
|



This changes how the policies are fetched from the archiver. Instead on every "processing", it is scheduled to a default of every hour and the result cached.
This separates the processing vs the fetching of policies from the archivers.