New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start Vitess when starting server in DEVELOPMENT environment #699
Conversation
8339d31
to
bff2508
Compare
|
||
@Qualifier | ||
@Target(AnnotationTarget.FIELD, AnnotationTarget.FUNCTION) | ||
annotation class Movies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note to self: rename this to MoviesDb
misk-hibernate/src/main/kotlin/misk/vitess/StartVitessService.kt
Outdated
Show resolved
Hide resolved
println("java.io.tmpdir = ${System.getProperty("java.io.tmpdir")}") | ||
// We can't use Files::createTempDirectory because it creates a directory under the path | ||
// /var/folders that is not possible to mount in Docker | ||
schemaDir = Paths.get("/tmp/vitess_schema_${System.currentTimeMillis()}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you’re trying to be unique, inject a TokenGenerator. currentTimeMillis() isn’t unique enough!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because VitessClusters are cached globally it's very awkward to inject into them. This will be sufficiently unique for our purposes I believe. Very rarely does a developer start more than a single cluster at exactly the same millisecond.
misk-hibernate/src/main/kotlin/misk/vitess/StartVitessService.kt
Outdated
Show resolved
Hide resolved
misk-hibernate/src/main/kotlin/misk/vitess/StartVitessService.kt
Outdated
Show resolved
Hide resolved
misk-hibernate/src/main/kotlin/misk/vitess/StartVitessService.kt
Outdated
Show resolved
Hide resolved
* Copy the resource to the specified filename [destination], creating all of the parent | ||
* directories if necessary. | ||
*/ | ||
private fun copyResource(address: String, destination: Path) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome
Love it! |
39b2faa
to
f5e8913
Compare
f5e8913
to
f094fbc
Compare
No description provided.