nfsantos commented on code in PR #871:
URL: https://github.com/apache/jackrabbit-oak/pull/871#discussion_r1138240887
##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexUpdate.java:
##########
@@ -330,9 +334,14 @@ private void collectIndexEditors(NodeBuilder definitions,
// then we don't need to handle missing handler
if (definition.hasProperty(ASYNC_PROPERTY_NAME) &&
rootState.async == null) {
if (!TYPE_DISABLED.equals(type)) {
- log.warn("Missing provider for nrt/sync index: {}
(rootState.async: {}). " +
- "Please note, it means that index data
should be trusted only after this index " +
- "is processed in an async indexing
cycle.", definition, rootState.async);
+ long now = System.currentTimeMillis();
+ if (now > lastMissingProviderMessageTime + 60 *
1000) {
+ lastMissingProviderMessageTime = now;
Review Comment:
I think this would work and is not too complicated.
```java
private static volatile AtomicLong lastMissingProviderMessageTime = new
AtomicLong(0);
long now = System.currentTimeMillis();
long previous = lastMissingProviderMessageTime.get();
if (now > previous + 60 * 1000) {
if (lastMissingProviderMessageTime.compareAndSet(previous, now)) {
// log
}
```
But leaving it here mainly for intelectual curiosity, could be useful in
other situations.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]