-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
setup api to check if a LF classic project exists #687
Comments
We could query MongoDB once or twice per day for a list of projectCodes, turn that list into a HashSet, and do an O(1) lookup on the HashSet to determine if a project exists. It would possibly fail for projects that were just created minutes ago in LF, but that might not be a big deal. (And there could be ways around that, such as having any |
Does the LexBox C# code already have a standard way to query the LF MongoDB? I forget. If it does, then I could help with the query. I would suggest a single query that returns a full list of all project codes hooked up to S/R. This should be performant and then we don't need to mount the LF S/R volume and create an unnecessary dependency. If you'd prefer I could probably create a LF API endpoint that provides this but then we have the issue of authentication which isn't built into the LF. API. |
In the lf-next branch I've implemented a way to query LF Mongo. And after thinking about it a bit I think that's probably going to be the best way to move forward. The way we can implement using the graphql loader is something like this on the project class public Task<bool> GetIsLanguageForgeProject(IsLanguageForgeProjectDataLoader loader) {
return loader.LoadAsync(Code);
} note: should probably be conditional based on if it's a FLEx project or not, we know that One story editor projects are not in LF for example. what gql will do behind the scenes is aggregate all those calls to load, and inside the loader (which is what needs to be implemented) LoadBatchAsync will be called with all the project codes this gql query is trying to resolve. Then we can execute a single mongo query to determine if all those projects exist or not. |
Yes, I agree that querying LF Mongo is going to be the way to go about this. We'll need to make sure we set up LF staging and production servers to allow connections to the Mongo pod from LexBox as well as from LF. (And if we have it wide-open to anything in the cluster, well, we should perhaps restrict that). |
you're right it is wide open, there's an issue for it already sillsdev/web-languageforge#1787 |
we want a way to determine if a project exists in LF classic. I'd like this to be very performant so we could potentially display it in a list of projects. It may be good enough to just mount the workspace volume and if the folder exists for the project in question.
options:
mount the lfmerge volume (not a good idea because volume is RWOsendreceive-data
)option 2 would probably be pretty easy, but I'm worried about the performance, I don't really like the idea of making a query to mongodb for each project but that might end up being the best solution.
The text was updated successfully, but these errors were encountered: