Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
resolver: check if update is needed #2249
For the global cache it is necessary to store the change indicators (e.g. timestamps) within the cache. We then need a way to let the resolvers check whether the timestamp of the cached data still corresponds to the timestamp of the original config file. In other words, we need a check whether the cached data is up-to-date.
In a private email @markus2330 suggested that it might be necessary to change the plugin interface and export an additional function for this purpose or to change the kdbGet() logic. He also noted, that @tom-wa might have some ideas because of his work on the multifile resolver.
The issue is open to find and document a solution, so all suggestions are welcome.
My initial idea for this was not to export and additional plugin function. It should also be possible to inject such a timestamp into the resolver by adding metadata to the parentKey. That still implies that the resolvers need to implement the desired functionality.
What I mean here is that multifile uses functions (in particular the function "filename") and enums of resolver. It only uses it to resolve filenames but not to get the timestamp. Something similar could be done to get the timestamps.
Alternatively, we could change the resolvers so that they check for the mmap file during their regular execution. The string of the parentKey could contain the timestamp to compare with for that purpose. And resolvers which are already up-to-date with the cache could return 0. (They already do this now but never during the first run of kdbGet()).