Permalink
Browse files

add temporary logging

  • Loading branch information...
bp-FLN committed Apr 3, 2017
1 parent 9158167 commit 5d3e600bc38dcd438b787147cfe04141df3f5c21
Showing with 5 additions and 1 deletion.
  1. +5 −1 grails-app/services/errbuddy/EntryCleanupService.groovy
@@ -10,24 +10,28 @@ class EntryCleanupService {
@Transactional(readOnly = true)
void handleEntryCleanupForApplication(App app) {
// get all group id's
log.info "$app: getting groups ..."
def groupIds = EntryGroup.createCriteria().list {
eq('app', app)
projections {
property('id')
}
}
log.info "$app: found ${groupIds.size()} groups"
groupIds.each { long entryGroupId ->
EntryGroup group = EntryGroup.read(entryGroupId)
log.info "$app: $group: getting entries ..."
def entryIds = Entry.createCriteria().list(max: 10000) {
eq('entryGroup', group)
lt('dateCreated', app.clearUntil)
projections {
property('id')
}
}
log.info "$app: $group: found ${entryIds.size()} entries"
if (entryIds) {
log.info "deleting ${entryIds.size()} for $group.entryGroupId of $app.name"
// log.info "deleting ${entryIds.size()} for $group.entryGroupId of $app.name"
entryIds.each {
jesqueService.enqueue(EntryDeleteJob.queueName, EntryDeleteJob, [it, true])
}

0 comments on commit 5d3e600

Please sign in to comment.