Skip to content

Commit

Permalink
chore: GrailsApplication getProperty
Browse files Browse the repository at this point in the history
Fixed other instances where grailsApplication.config.property pattern was used. Also included defaulting to 3 concurrent jobs total in dc profile
  • Loading branch information
EthanFreestone committed Oct 3, 2024
1 parent 75a8bdc commit 91c9102
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions service/grails-app/conf/application-dc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ okapi:
logging:
config: classpath:logback-development.xml

concurrentJobsGlobal: "${CONCURRENT_JOBS_GLOBAL:3}"


# register: true
Expand Down
10 changes: 5 additions & 5 deletions service/grails-app/init/org/olf/BootStrap.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ class BootStrap {
});

log.info("mod-agreements startup report");
log.info("${grailsApplication.getMetadata().getApplicationName()} (${grailsApplication.config?.info?.app?.version}) initialising");
log.info("${grailsApplication.getMetadata().getApplicationName()} (${grailsApplication.config?.getProperty('info.app.version')}) initialising");
log.info(" build number -> ${grailsApplication.metadata['build.number']}");
log.info(" build revision -> ${grailsApplication.metadata['build.git.revision']}");
log.info(" build branch -> ${grailsApplication.metadata['build.git.branch']}");
log.info(" build commit -> ${grailsApplication.metadata['build.git.commit']}");
log.info(" build time -> ${grailsApplication.metadata['build.time']}");
log.info(" build host -> ${grailsApplication.metadata['build.host']}");
log.info(" Base JDBC URL -> ${grailsApplication.config.dataSource.url} / ${grailsApplication.config.dataSource.username}");
log.info(" default_aws_region -> ${grailsApplication.config.kiwt?.filestore?.aws_region}");
log.info(" default_aws_url -> ${grailsApplication.config.kiwt?.filestore?.aws_url}");
log.info(" default_aws_bucket -> ${grailsApplication.config.kiwt?.filestore?.aws_bucket}");
log.info(" Base JDBC URL -> ${grailsApplication.config.getProperty('dataSource.url')} / ${grailsApplication.config.getProperty('dataSource.username')}");
log.info(" default_aws_region -> ${grailsApplication.config.getProperty('kiwt.filestore.aws_region')}");
log.info(" default_aws_url -> ${grailsApplication.config.getProperty('kiwt.filestore.aws_url')}");
log.info(" default_aws_bucket -> ${grailsApplication.config.getProperty('kiwt.filestore.aws_bucket')}");

Map<String, String> env = System.getenv();
env.each { name,value ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class DependentModuleProxyService {
log.debug "No local org for ${orgName}. Check vendors."

def mod_vendor_lookup_result = null;
if ( grailsApplication.config.useModVendors ) {
if ( grailsApplication.config.getProperty('useModVendors', boolean) ) {
// This fetches a max of 2 (we should decide how to handle multiple matches) vendors with an exact name match.
mod_vendor_lookup_result = okapiClient.get("/vendor", [
limit: 2,
Expand Down Expand Up @@ -68,7 +68,7 @@ public class DependentModuleProxyService {
case 0:
// No match
// We should add in an option to create vendors if users configure that
if ( grailsApplication.config.createMissingVendors ) {
if ( grailsApplication.config.getProperty('createMissingVendors', boolean) ) {
throw new RuntimeException("Not yet implemented");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ public class ErmHousekeepingService {
RefdataValue.lookupOrCreate('FileStorageEngines', 'LOB');
RefdataValue.lookupOrCreate('FileStorageEngines', 'S3');

def default_aws_region = grailsApplication.config.kiwt?.filestore?.aws_region
def default_aws_url = grailsApplication.config.kiwt?.filestore?.aws_url
def default_aws_secret = grailsApplication.config.kiwt?.filestore?.aws_secret
def default_aws_bucket = grailsApplication.config.kiwt?.filestore?.aws_bucket
def default_aws_access_key_id = grailsApplication.config.kiwt?.filestore?.aws_access_key_id
def default_aws_region = grailsApplication.config.getProperty('kiwt.filestore.aws_region')
def default_aws_url = grailsApplication.config.getProperty('kiwt.filestore.aws_url')
def default_aws_secret = grailsApplication.config.getProperty('kiwt.filestore.aws_secret')
def default_aws_bucket = grailsApplication.config.getProperty('kiwt.filestore.aws_bucket')
def default_aws_access_key_id = grailsApplication.config.getProperty('kiwt.filestore.aws_access_key_id')

// Bootstrap any app settings we may need
[
Expand Down
2 changes: 1 addition & 1 deletion service/src/main/okapi/tenant/sample_data/_data.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RemoteKB.findByName('GOKb') ?: (new RemoteKB(
uri:'https://gokb.org/gokb/oai/index',
fullPrefix:'gokb',
rectype: RemoteKB.RECTYPE_PACKAGE,
active:Boolean.FALSE,
active:Boolean.TRUE,
supportsHarvesting:true,
activationEnabled:false
).save(failOnError:true))
Expand Down

0 comments on commit 91c9102

Please sign in to comment.