inventree_part_import
inventree_part_import copied to clipboard
A disk-based cache for all provider queries to prevent provider API throttling
If you play around with settings and importing parts too much, you might get yourself throttled or blocked by the providers. Adding caching would prevent you from repeating the same queries to the providers, saving you from this fate.
Might make sense to use something like diskcache (sqlite-based) to cache all provider queries based on the arguments, with a configurable TTL (say 6h for a default).
This would imply that if you have caching enabled, whenever you search for a part or similar, the result is cached. If you search for it again in the next n hours, you'll just get the cached response and you won't hit the API again, lessening the chance of getting yourself throttled.
Might make sense to add a CLI arg for avoiding cache, and a subcommand or flag for clearing it.