Skip to content

Commit

Permalink
Merge pull request #444 from khoa-nd/master
Browse files Browse the repository at this point in the history
Merged
  • Loading branch information
khoa-nd committed Oct 30, 2015
2 parents d2021bf + 7b01990 commit 30d3010
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/techlooper/cron/JobAlertEmailSender.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public synchronized void sendJobAlertEmail() throws Exception {

if (!jobAlertRegistrationEntities.isEmpty()) {
int count = 0;
Thread.sleep(getRandomNumberInRange(600000, 900000) + 600000);
for (JobAlertRegistrationEntity jobAlertRegistrationEntity : jobAlertRegistrationEntities) {
if (StringUtils.isEmpty(jobAlertRegistrationEntity.getLastEmailSentDateTime())) {
jobAlertRegistrationEntity.setLastEmailSentDateTime(yesterdayDate(BASIC_DATE_TIME_PATTERN));
Expand All @@ -63,7 +64,6 @@ public synchronized void sendJobAlertEmail() throws Exception {
Date lastSentDate = string2Date(jobAlertRegistrationEntity.getLastEmailSentDateTime(), BASIC_DATE_TIME_PATTERN);
Date currentDate = new Date();

Thread.sleep(getRandomNumberInRange(1000, 5000));
if (daysBetween(lastSentDate, currentDate) > 0) {
JobSearchCriteria criteria = dozerMapper.map(jobAlertRegistrationEntity, JobSearchCriteria.class);
JobSearchResponse jobSearchResponse = jobAggregatorService.findJob(criteria);
Expand Down

0 comments on commit 30d3010

Please sign in to comment.