-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
An easy option is to add an --invalidate flag that, rather than retrieving the command simply deletes the cache key associated with the given command, like so:
$ bkt -- date
Sun 21 Nov 2021 11:17:03 AM PST
$ bkt -- date
Sun 21 Nov 2021 11:17:03 AM PST
$ bkt --invalidate -- date
$ bkt -- date
Sun 21 Nov 2021 11:17:13 AM PST
But it might be preferable to support some sort of more powerful invalidation, such as the ability to invalidate all calls to a given command, e.g.:
$ bkt -- date +%T
11:18:19
$ bkt -- date +%T
11:18:19
$ bkt --invalidate=date
$ bkt -- date +%T
11:18:32
However bkt doesn't currently have any way to introspect the cache like this, short of a linear search. That might be fine, but otherwise either the key space would need to be redesigned or some secondary index would need to be maintained.
Also --scope can be used to invalidate the cache, as long as all callers participate in using the right scope.
Metadata
Metadata
Assignees
Labels
No labels