Skip to content

Commit

Permalink
docs(taskfile): add flowchart for intended behaviour of Cache
Browse files Browse the repository at this point in the history
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
jlucktay committed Jul 11, 2024
1 parent cdafc67 commit ba11775
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions taskfile/README.md
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
```

0 comments on commit ba11775

Please sign in to comment.