Skip to content

add resetable sync.Once for timed caching of ctags globs

Administrator requested to merge nsc/symbolsclient-resettable-once into main

Created by: Strum355

Previously, querying the list of supported languages by the symbols service would perform a request every time, followed by compiling the returned globs without any caching. This was "fine" for the individual blob view, but would quickly add up in the tree view and beyond. This PR addresses this by using a resetable sync.Once to perform the requesting and compiling of globs only at most once every 10 minutes.

Test plan

I used print statements to make sure the code was only being called once every x units of time 🙂

Merge request reports

Loading