Skip to content

Commit

Permalink
Merge pull request #12 from wizpanda/deletion-fixes
Browse files Browse the repository at this point in the history
Minor fixes, added 15 min start delay in delete marked file job.
  • Loading branch information
sagrawal31 committed Oct 19, 2018
2 parents 3717ef9 + b4de5ad commit ac9d737
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions grails-app/jobs/com/wizpanda/file/DeleteMarkedFileJob.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -31,7 +31,7 @@ class FileDeletionService {
isNotNull("markedForDeletion")
le("markedForDeletion", dateForDeletion)

maxResult(MAX)
maxResults(MAX)
}

storedFileList.each { StoredFile storedFile ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.wizpanda.file
import grails.testing.services.ServiceUnitTest
import spock.lang.Specification

class FileDeletionServiceSpec extends Specification implements ServiceUnitTest<FileDeletionService>{
class FileDeletionServiceSpec extends Specification implements ServiceUnitTest<FileDeletionService> {

def setup() {
}
Expand All @@ -12,7 +12,7 @@ class FileDeletionServiceSpec extends Specification implements ServiceUnitTest<F
}

void "test something"() {
expect:"fix me"
true == false
expect: "fix me"
true == false
}
}

0 comments on commit ac9d737

Please sign in to comment.