forked from go-task/task
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(taskfile): add flowchart for intended behaviour of Cache
Mapped out a flowchart to describe the behaviour of taskfile.Cache, so as to aid technical design and implementation. re go-task#1402
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# The `taskfile` package | ||
|
||
```mermaid | ||
--- | ||
title: taskfile.Cache behaviour | ||
--- | ||
flowchart LR | ||
%% Beginning state | ||
start([A remote Taskfile | ||
is required]) | ||
%% Checks to decide | ||
cached{Remote Taskfile | ||
already cached?} | ||
subgraph checkTTL [Is the cached Taskfile still inside TTL?] | ||
%% Beginning state | ||
lastModified(Stat the cached | ||
Taskfile and get last | ||
modified timestamp) | ||
%% Check to decide | ||
timestampPlusTTL{Timestamp | ||
plus TTL is in | ||
the future?} | ||
%% Flowlines | ||
lastModified-->timestampPlusTTL | ||
end | ||
%% End states | ||
useCached([Use the | ||
cached Taskfile]) | ||
download(["(Re)download the | ||
remote Taskfile"]) | ||
%% Flowlines | ||
start-->cached | ||
cached-- Yes -->lastModified | ||
cached-- No -->download | ||
timestampPlusTTL-- Yes -->useCached | ||
timestampPlusTTL-- No -->download | ||
``` |