-
Notifications
You must be signed in to change notification settings - Fork 9
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
dbmss info subscription #337
Conversation
@Context('environment') environment: Environment, | ||
): Promise<AsyncIterator<unknown, any, undefined>> { | ||
// @todo: this isn't fleshed out yet and is simplistic | ||
// @todo: how to detect or handle unsubsribe? how to handle multiple watchers for an env? |
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.
Might be worth looking into this: nestjs/graphql#186 (comment)
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.
Yeah I looked into this. I couldn't get it to work yet but can take another look.
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.
Left a note in the PR description. Just wondering if I should look into this and get it working now? Or save for next phase?
}); | ||
|
||
const eventHandler = (e: string) => { | ||
const dbmsIdCheck = e.match(/dbms-([^/]*)/); |
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.
const dbmsIdCheck = e.match(/dbms-([^/]*)/); | |
const dbmsIdCheck = e.match(/dbms-([^/]+)/); |
// @todo: how to detect or handle unsubsribe? how to handle multiple watchers for an env? | ||
if (!environmentWatchers.get(environment.id)) { | ||
// set watcher for environment | ||
const setWatcher = (watchPath: string) => { |
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.
Could be worth extracting this into a util
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.
Ill see. It might become more obvious when we add another subscription later. Ill look into it.
7d6ca73
to
36ed76f
Compare
@Context('environment') environment: Environment, | ||
): Promise<AsyncIterator<unknown, any, undefined>> { | ||
if (!environmentWatchers.get(environment.id)) { | ||
const watcher = setWatcher(path.join(environment.dirPaths.dbmssData, '**', 'run', '*.pid')); |
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.
will assign this path to a variable somewhere better at the end.
cdfd177
to
7ae5d4b
Compare
d49b8ef
to
76efa2e
Compare
76efa2e
to
50b75e7
Compare
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.
Looks good ✨
Please check if the PR fulfills these requirements
What kind of change does this PR introduce?
graphql-subscriptions
andchokidar
in order to set up a watcher looking forneo4j.pid
files being created / unlinked to establish dbms start / stop and publish an eventWhat is the current behavior?
What is the new behavior?
watchInfoDbmss
to getDbmsInfo
for a relevant DBMS started / stoppedDoes this PR introduce a breaking change?
No
Other information: