quarkiverse / quarkus-bon-jova-rockstar

An implementation of Rockstar as a JVM language
https://codewithrockstar.com/
3 stars 2 forks source link

Can we cache the lyrics in the extension so apps can be run offline? #80

Closed holly-cummins closed 7 months ago

holly-cummins commented 7 months ago

I notice if I run the quarkus app offline, I get the following failures:

Caused by: java.util.concurrent.ExecutionException: java.net.UnknownHostException: api.lyrics.ovh
        at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
        at org.example.bon.jova.quarkus.extension.deployment.lyrics.RemoteLyricsReader.lambda$readRemoteLyrics$2(RemoteLyricsReader.java:149)
        ... 24 more
Caused by: java.net.UnknownHostException: api.lyrics.ovh
        at java.base/java.net.InetAddress$CachedLookup.get(InetAddress.java:988)

If we baked the lyrics into the extension, the app could run without needing network access. That might make demos more robust.

Obviously, this is only a nice-to-have, and not critical.

hannotify commented 7 months ago

That is a good point - I could probably make it work by changing the target/lyrics destination to src/main/resources/lyrics and putting that location in the .gitignore. Then already downloaded lyrics could survive an mvn clean.

holly-cummins commented 7 months ago

I think there's two potential solutions:

I had in mind the second, but making a jar full of song lyrics and putting it on maven central might not be ideal in terms of copyright, in the same way that putting them in our repo wasn't. :)

hannotify commented 7 months ago

Solution #3: just expose the lyrics frequencies in the extension, because other than those the app doesn't need anything else.