-
Notifications
You must be signed in to change notification settings - Fork 0
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
Inefficient caching of FdsnNetExtender.extend() #8
Comments
Nice spotting. I'll fix fdsnnetextender. |
fdsnnetextender 3.3.0 implements caching of the FDSN request only. Tests are OK. Could you upgrade only this package ? If it's working alright, then we advertise the new version to everyone, it's an important fix. |
Seems to work OK now. |
Let it run during the week end. On monday, if everything is fine, I'll make an announce for everyone to update. Thank you for your help ! |
@andres-h can you confirm that this fix is improving the situation ? |
Thank you for your help ! |
FdsnNetExtender.extend(self, net, date_string) has lru_cache(maxsize=1000), but since date_string is different most of the time, caching seems to be inefficient. In any case, I can observe urls like http://www.fdsn.org/ws/networks/1/query?fdsn_code=3E being downloaded hundreds of times. Sometimes this causes an exception, which seems to be the reason of incomplete statistics at GFZ.
Maybe date_string should be reduced to year (two different temporary networks with the same code never exist in same year?). Alternatively I would suggest caching the result of urlopen(request).
The text was updated successfully, but these errors were encountered: