You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 12, 2020. It is now read-only.
I add to my code:
Runtime.getRuntime.addShutdownHook(new Thread(() => {
postgres.stop()
}))
I want postgres to stop when app stops. It does not happen.
I can see that stop is running, I'm getting to forceDelete - my temp folder.
It fails to delete my temp folder so it's trying to force delete on exist by adding it to shutdownhook (isn't it too late now?).
Then I get an exception that says:
Exception in thread "Thread-8" java.lang.IllegalStateException: Shutdown in progress
at java.lang.ApplicationShutdownHooks.add(ApplicationShutdownHooks.java:66)
at java.lang.Runtime.addShutdownHook(Runtime.java:211)
at de.flapdoodle.embed.process.io.file.FileCleaner.forceDeleteOnExit(FileCleaner.java:51)
at de.flapdoodle.embed.process.io.file.Files.forceDelete(Files.java:128)
at ru.yandex.qatools.embed.postgresql.PostgresProcess.deleteTempFiles(PostgresProcess.java:236)
at ru.yandex.qatools.embed.postgresql.PostgresProcess.stopInternal(PostgresProcess.java:158)
at de.flapdoodle.embed.process.runtime.AbstractProcess.stop(AbstractProcess.java:177)
at ru.yandex.qatools.embed.postgresql.EmbeddedPostgres.stop(EmbeddedPostgres.java:216)
at com.flir.mock.EmbeddedPostgresSQL.$anonfun$new$1(EmbeddedPostgresSQL.scala:16)
at java.lang.Thread.run(Thread.java:748)
Process finished with exit code 0
Thanks,
Rinat
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I add to my code:
Runtime.getRuntime.addShutdownHook(new Thread(() => {
postgres.stop()
}))
I want postgres to stop when app stops. It does not happen.
I can see that stop is running, I'm getting to forceDelete - my temp folder.
It fails to delete my temp folder so it's trying to force delete on exist by adding it to shutdownhook (isn't it too late now?).
Then I get an exception that says:
Thanks,
Rinat
The text was updated successfully, but these errors were encountered: