Hello,
I have a clojure server that is slow to start up, and fly is refusing to connect because the server is not up yet. Is there a way to specify a delay before fly connects to the machine?
Here is the output from fly logs:
2024-01-21T18:48:09Z app[148ed195c93678] sin [info] INFO Starting init (commit: 8995e367)...
2024-01-21T18:48:09Z app[148ed195c93678] sin [info] INFO Mounting /dev/vdb at /data w/ uid: 0, gid: 0 and chmod 0755
2024-01-21T18:48:09Z app[148ed195c93678] sin [info] INFO Resized /data to 3204448256 bytes
2024-01-21T18:48:09Z app[148ed195c93678] sin [info] INFO Preparing to run: `java -Xint -jar rm-standalone.jar` as root
2024-01-21T18:48:09Z app[148ed195c93678] sin [info] INFO [fly api proxy] listening at /.fly/api
2024-01-21T18:48:09Z app[148ed195c93678] sin [info]2024/01/21 18:48:09 listening on [fdaa:5:89b3:a7b:187:dedd:6d36:2]:22 (DNS: [fdaa::3]:53)
2024-01-21T18:48:09Z proxy[148ed195c93678] sin [info]machine started in 519.762869ms
2024-01-21T18:48:15Z proxy[148ed195c93678] sin [info]waiting for machine to be reachable on 0.0.0.0:8080 (waited 5.292465366s so far)
2024-01-21T18:48:18Z proxy[148ed195c93678] sin [error]failed to connect to machine: gave up after 15 attempts (in 8.270759979s)
2024-01-21T18:48:18Z proxy[148ed195c93678] sin [error]instance refused connection. is your app listening on 0.0.0.0:8080? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers
often print the address they are listening on)
2024-01-21T18:48:21Z app[148ed195c93678] sin [info]2024-01-21 18:48:21,997 [main] INFO migratus.core: Starting migrations
2024-01-21T18:48:24Z app[148ed195c93678] sin [info]2024-01-21 18:48:24,934 [main] INFO migratus.core: Ending migrations
2024-01-21T18:48:25Z app[148ed195c93678] sin [info]2024-01-21 18:48:25,260 [main] INFO rm.config: Server started on port: 8080
2024-01-21T18:48:25Z app[148ed195c93678] sin [info]2024-01-21 18:48:25,365 [main] INFO org.eclipse.jetty.server.Server: jetty-11.0.18; built: 2023-10-27T02:14:36.036Z; git: 5a9a771a9fbcb9d36993630850f612581b78c
13f; jvm 21.0.1+12-LTS
2024-01-21T18:48:25Z app[148ed195c93678] sin [info]2024-01-21 18:48:25,492 [main] INFO org.eclipse.jetty.server.handler.ContextHandler: Started o.e.j.s.ServletContextHandler@6cd31e5f{/,null,AVAILABLE}
2024-01-21T18:48:25Z app[148ed195c93678] sin [info]2024-01-21 18:48:25,504 [main] INFO org.eclipse.jetty.server.AbstractConnector: Started ServerConnector@44b99f09{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2024-01-21T18:48:25Z app[148ed195c93678] sin [info]2024-01-21 18:48:25,509 [main] INFO org.eclipse.jetty.server.Server: Started Server@1737acc0{STARTING}[11.0.18,sto=0] @15717ms