-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Description
I'm not sure how common/useful this would really be, but I can imagine wanting to use a file's modtime as an input to a command's cache key (alongside the cwd or environment). As a toy example:
$ bkt --modtime infrequent_updates.json --ttl=1d -- jq -f infrequent_updates.json '{foo: .bar}'This assumes some occasional background job writes updates to infrequent_updates.json. We can generally rely on the cached data, so a long TTL is preferable, but we want to pick up updates as quickly as possible.
Users can accomplish this today using --scope like so:
$ bkt --scope="$(stat -c '%n:%Y' infrequent_updates.json)" --cwd --ttl=1d -- jq -f infrequent_updates.json '{foo: .bar}'But this means launching two additional processes (the command substitution subprocess and stat) on each call. Doing a modtime check in-process would be much lighter weight.
Metadata
Metadata
Assignees
Labels
No labels