Notification grace period - bugfix

NotificationGracePeriodService.inGracePeriod() method does not update cache if lastEventTime.isPresent() is true, but the period is over.
I would suggest the following change:

public boolean inGracePeriod(EventDefinition definition, String notificationId, Event event) {
    if (definition.notificationSettings().gracePeriodMs() <= 0) {
        return false;
    final Optional<DateTime> lastEventTime = get(, notificationId, event.toDto().key());
    final boolean isInGracePeriod = lastEventTime.isPresent() ?
            lastEventTime.get().isAfter(event.getEventTimestamp().minus(definition.notificationSettings().gracePeriodMs())) :
    put(, notificationId, event.toDto().key(), event.getEventTimestamp());
    return isInGracePeriod;



do you mind opening a pull request over at github?

feel free to do anything you like.
i just solved my problem.

ср, 6 мая 2020 г., 17:23 Jan Doberstein via Graylog Community <>:

Thank you @sergei.melnichenko for the fix. :slight_smile:
You can track it’s progress here:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.