diff --git a/grails-app/jobs/com/wizpanda/file/DeleteMarkedFileJob.groovy b/grails-app/jobs/com/wizpanda/file/DeleteMarkedFileJob.groovy index 897bafc..b19fdf2 100644 --- a/grails-app/jobs/com/wizpanda/file/DeleteMarkedFileJob.groovy +++ b/grails-app/jobs/com/wizpanda/file/DeleteMarkedFileJob.groovy @@ -4,14 +4,16 @@ package com.wizpanda.file * Job to delete marked stored files from S3. * * @author Ankit Kumar Singh - * @since 1.0.3 + * @since 0.1.3 */ class DeleteMarkedFileJob { FileDeletionService fileDeletionService + def concurrent = false + static triggers = { - simple repeatInterval: 1000l * 60 * 60 * 2 // execute job once in 2 hour + simple startDelay: 1000l * 60 * 15, repeatInterval: 1000l * 60 * 60 * 2 // execute job once in 2 hour } def execute() { diff --git a/grails-app/services/com/wizpanda/file/FileDeletionService.groovy b/grails-app/services/com/wizpanda/file/FileDeletionService.groovy index 502596d..1c3995a 100644 --- a/grails-app/services/com/wizpanda/file/FileDeletionService.groovy +++ b/grails-app/services/com/wizpanda/file/FileDeletionService.groovy @@ -8,7 +8,7 @@ import groovy.time.TimeCategory * Service class to perform delete operations on file which are marked for deletion. * * @author Ankit Kumar Singh - * @since 1.0.3 + * @since 0.1.3 */ @Transactional class FileDeletionService { @@ -31,7 +31,7 @@ class FileDeletionService { isNotNull("markedForDeletion") le("markedForDeletion", dateForDeletion) - maxResult(MAX) + maxResults(MAX) } storedFileList.each { StoredFile storedFile -> diff --git a/src/test/groovy/com/wizpanda/file/FileDeletionServiceSpec.groovy b/src/test/groovy/com/wizpanda/file/FileDeletionServiceSpec.groovy index c72ac5c..b48593f 100644 --- a/src/test/groovy/com/wizpanda/file/FileDeletionServiceSpec.groovy +++ b/src/test/groovy/com/wizpanda/file/FileDeletionServiceSpec.groovy @@ -3,7 +3,7 @@ package com.wizpanda.file import grails.testing.services.ServiceUnitTest import spock.lang.Specification -class FileDeletionServiceSpec extends Specification implements ServiceUnitTest{ +class FileDeletionServiceSpec extends Specification implements ServiceUnitTest { def setup() { } @@ -12,7 +12,7 @@ class FileDeletionServiceSpec extends Specification implements ServiceUnitTest