kermitt2 / biblio-glutton

A high performance bibliographic information service: https://biblio-glutton.readthedocs.io
117 stars 15 forks source link

Pconfig setting not used for server command #94

Closed karatekaneen closed 2 months ago

karatekaneen commented 2 months ago

When setting up the latest version I noticed that the Pconfig option wasn't respected when starting the server. It does work when indexing.

Notice in the output below that it's using the default path even though I provided a custom one.

Output:

$ ./gradlew server -Pconfig=/mnt/disks/glutton-data/config/glutton.yml

> Task :server
java.io.FileNotFoundException: File config/glutton.yml not found
        at io.dropwizard.configuration.FileConfigurationSourceProvider.open(FileConfigurationSourceProvider.java:18)
        at io.dropwizard.configuration.BaseConfigurationFactory.build(BaseConfigurationFactory.java:85)
        at io.dropwizard.core.cli.ConfiguredCommand.parseConfiguration(ConfiguredCommand.java:139)
        at io.dropwizard.core.cli.ConfiguredCommand.run(ConfiguredCommand.java:85)
        at io.dropwizard.core.cli.Cli.run(Cli.java:78)
        at io.dropwizard.core.Application.run(Application.java:94)
        at com.scienceminer.glutton.web.LookupServiceApplication.main(LookupServiceApplication.java:200)

> Task :server FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':server'.
> Process 'command '/usr/lib/jvm/java-11-openjdk-amd64/bin/java'' finished with non-zero exit value 1

When moving the config to the relative dir config/glutton.yml it works.

kermitt2 commented 2 months ago

Hi @karatekaneen and thanks a lot for issue.

Sorry for this, just being lazy and a cut and paste missing :) Normally fixed with 5dc0f48868fe8a73553a0bb3e1a93b5aaa47cf72

karatekaneen commented 2 months ago

Looks like it has been solved. Haven't verified it yet but looking at the code it feels like a no-brainer :)

Thanks!