public void run() {
try {
log.info("Running GenerateNewAlertEvaluationQueue");
AlertEvaluationQueueDao alertEvaluationQueueDao = dbPlugin.getAlertEvaluationQueueDao();
long evaluationThreshold = System.currentTimeMillis() - 15000;
List<Account> accountListForEvaluation = new ArrayList<>();
for (Account account : dbPlugin.getAccountDao().getAccounts()) {
log.info("Testing to see if account " + account.getId() + " needs to be evaluated");
if (account.getLastEvaluatedForAlerts() == null || account.getLastEvaluatedForAlerts() < evaluationThreshold) {
log.info("Adding " + account.getId() + " to new queue");
accountListForEvaluation.add(account);
}
}
alertEvaluationQueueDao.addAccountsToNewQueue(accountListForEvaluation);
} catch (Exception e) {
e.printStackTrace();
}
}