package foam.nanos.cron;

import foam.core.ContextAgent;
import foam.core.Detachable;
import foam.core.X;
import foam.dao.AbstractSink;
import foam.dao.DAO;
import foam.mlang.MLang;
import foam.nanos.notification.Notification;
import java.util.Date;

public class RemoveExpiredNotificationCronjob implements ContextAgent {
  @Override
  public void execute(X x){
    DAO notificationDAO = (DAO) x.get("notificationDAO");
    notificationDAO.where(MLang.LTE(Notification.EXPIRY_DATE, new Date())).removeAll();
  }
}

@@ -440,16 +440,38 @@
 O.where(
+%0A    MLang.AND(%0A      
 MLang.LT
@@ -508,16 +508,73 @@
 w Date()
+),%0A      MLang.NEQ(Notification.EXPIRY_DATE, null)%0A      
 )).remov

add one more condition to check if expire date is null (#3501)