Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More time to check wether ExportToOpal succeeded or not #190

Merged
merged 1 commit into from Jan 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion application.properties
Expand Up @@ -2,4 +2,4 @@
#Sat Jan 05 12:13:45 CET 2013
app.grails.version=2.5.1
app.name=gscf
app.version=2.0.16
app.version=2.0.17
11 changes: 4 additions & 7 deletions grails-app/controllers/api/ApiController.groovy
Expand Up @@ -933,23 +933,20 @@ class ApiController {

String checkTableCommand = "opal data phenotypedatabase-exported.${table} --opal ${opalUrl} --user ${opalUser} --password ${opalPassword} --json".toString()

println featureImportCommand[2]
println dataImportCommand
//
def i = 0
def assayInOpal = false

// Check if assay becomes available in Opal so the response does not come back while Opal is still processing
while( !assayInOpal && i < 30 ) {
while( !assayInOpal && i < 60 ) {

String dataCommandOutput = checkTableCommand.execute().text

if ( JSON.parse( dataCommandOutput ).size() != 0 ) {
assayInOpal = true
}
else {
// Delay next try for two seconds
sleep(2000 )
// Delay next try for 10 seconds
sleep( 10000 )
}

i ++
Expand All @@ -959,7 +956,7 @@ class ApiController {
result = [ 'status': "Export to Opal succeeded", 'project': 'phenotypedatabase-exported', 'table': table ]
}
else {
log.error("ExportToOpal not successful after 1 minute for assayId ${assay.id}: ${dataImportCommandExecuteText}")
log.error("ExportToOpal not successful after 10 minutes for assayId ${assay.id}: ${dataImportCommandExecuteText}")
}

if (params.containsKey('callback')) {
Expand Down