Skip to content

Commit

Permalink
알람 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
1angerhans committed Aug 13, 2019
1 parent ecb4e1e commit 5cc7f76
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions grails-app/jobs/NotificationJob.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,38 @@ class NotificationJob {
void execute(){

Date now = new Date()
println "NotificationJob excution date ${now} / lastsent ${lastSend}"

def notes = Content.findAll {
and {
eq('type', ContentType.NOTE)
gt('dateCreated', lastSend)
try {

def notes = Content.findAll {
and {
eq('type', ContentType.NOTE)
gt('dateCreated', lastSend)
}
}
}

def votes = ContentVote.findAll {
and {
gt('point', 0)
gt('dateCreated', lastSend)
def votes = ContentVote.findAll {
and {
gt('point', 0)
gt('dateCreated', lastSend)
}
}
}

notes.each { note ->
notificationService.createFromNote(note)
}
notes.each { note ->
notificationService.createFromNote(note)
}

votes.each { vote ->
notificationService.createFromAccent(vote)
}
votes.each { vote ->
notificationService.createFromAccent(vote)
}
} catch(Exception e) {

// println "NotificationJob excution time ${new Date().time-now.time}ms"
}

lastSend = now


// println "NotificationJob excution time ${new Date().time-now.time}ms"
}
}

0 comments on commit 5cc7f76

Please sign in to comment.