Skip to content

Instantly share code, notes, and snippets.

@ryanwalker
Created October 16, 2012 21:34
Show Gist options
  • Save ryanwalker/3902190 to your computer and use it in GitHub Desktop.
Save ryanwalker/3902190 to your computer and use it in GitHub Desktop.
@ManagedOperation
@Scheduled(cron = "0 0 0 * * SUN")
public void purgeOrphanedScores() {
synchronized (LeadScoringServiceDb.class) {
stopWatchStart("purgeOrphanedScores");
try {
int orphanedScoreCount = scoreDAO.getOrphanedScoreCount();
if (orphanedScoreCount > 0) {
scoreDAO.deleteOrphanedScores();
Log.info(Log.Context.LeadScoring, "Deleted " + orphanedScoreCount + " orphaned scores");
}
} catch (BridgeException e) {
Log.error(Log.Context.Contact, e);
}
stopWatchStop("purgeOrphanedScores");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment