Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Speeding up package search requests #25

Open
jonathansberry opened this issue Sep 15, 2021 · 1 comment
Open

Speeding up package search requests #25

jonathansberry opened this issue Sep 15, 2021 · 1 comment

Comments

@jonathansberry
Copy link

jonathansberry commented Sep 15, 2021

Hi there,

We're using a fork of ckanext-restricted, thanks for the good work in preparing the repo.

I'm puzzled by the following line:

authorized = auth.restricted_resource_show(

Can you give some further info on it's purpose? The output of the line appears to be ignored by the code. Removing the line doesn't break any tests, and at the moment I haven't been able to see that it has any impact on the UI or api requests.

Is it's job to raise some exceptions? I can see that during execution of this line check_access is called for the "package_show" action on the resource's parent pacakge, however, any exceptions raised by this are not caught which seems slightly odd to me - I wouldn't want someone to be unauthorised to view all their search results just because they don't have access to view one of their search results.

...maybe I'm missing something obvious!

We're having problems with ckanext-requests slowing down package_search requests. By my reckoning this line is slowing down package_search requests by a factor >4x what it is without the line, so I want to be clear on why it is there.

Jonathan Berry
fjelltopp.org

@espona
Copy link
Contributor

espona commented Sep 15, 2021

Hi Jonathan,

It may be a deprecated line from the previous version that was even slower. We are quite short on resources to work on this package. I will try to find some time to check on this next week, but please if you consider you have done enough testing you can do a pull request.

Thanks a lot for your contribution,
Lucia

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants