The metainfo / api has gone through few iterations and while it's cleanest it has ever been it's still not very easy to grasp.
There is api_xy.py under /internal that does the actual url and db cache lookup. A object representing the lookup is defined and stored in the db.Then there is a xy_lookup.py under
The API plugins under /internal are supposed to provide way to query the provider and cache the results.
/metainfo that is a general plugin interface, to-be used externally.The lookup plugin uses the register_lazy_func to add a callback function for lookup.
I assume that callback is only used, if the field name is actually accessed for the first time?
Precisely, the lookup_xxx plugins are currently used to enable that lookup specific lazy fields which are evaluated/queried ONLY if accessed.
The api_xy file seems to manually do the db caching for its objects.
Thats the main part i have no experience with and are a but confused on whats going on.
It's just using SQLAlchemy to cache data so subsequent runs do not cause HTTP queries for same items. Some people run tasks in ridiculously high frequency and it is unacceptable to spam metainfo providers with that amount of queries.