Skip to content

Commit

Permalink
Always save cache
Browse files Browse the repository at this point in the history
  • Loading branch information
klaftertief committed Nov 27, 2023
1 parent 08153e0 commit 8cecd3b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ jobs:
with:
node-version: 18
cache: 'npm'
- name: Restore cached Primes
- name: Restore cache
id: cache-generated-elm-modules-restore
uses: actions/cache/restore@v3
with:
path: cache
key: ${{ runner.os }}-generated-elm-modules
- run: make install
- run: make clean setup build
- name: Save Primes
- name: Save cache
if: always()
id: cache-generated-elm-modules-save
uses: actions/cache/save@v3
with:
Expand Down
28 changes: 20 additions & 8 deletions src/scripts/Setup.elm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Http
import Json.Decode as Decode
import Process
import Set
import Task
import Task exposing (Task)


type alias Model =
Expand Down Expand Up @@ -73,9 +73,26 @@ planFileWrites partials =
in
writeOutput (Generate.main_ moduleNames)
:: List.map2 Cache.check moduleNames partials
--|> List.indexedMap
-- (\i cmd ->
-- Process.sleep (toFloat i * 10)
-- |> Task.andThen (\_ -> cmd)
-- )
|> Cmd.batch


delay : Int -> Cmd msg -> Cmd msg
delay ms cmd =
Process.sleep (toFloat ms)
|> Task.andThen (\_ -> cmd)


toCmd : Task Never (Cmd msg) -> Cmd msg
toCmd task =
Task.perform identity task
|> Cmd.unwrap


fetchDocs : String -> Package.Metadata -> Cmd Msg
fetchDocs elmVersion metadata =
if Blacklist.contains metadata then
Expand All @@ -93,13 +110,8 @@ fetchDocs elmVersion metadata =
decoder =
Package.decode elmVersion metadata
in
Process.sleep 1000
|> Task.andThen
(\_ ->
Http.get url decoder
|> Http.toTask
)
|> Task.attempt (ensureOk Response)
Http.get url decoder
|> Http.send (ensureOk Response)



Expand Down

0 comments on commit 8cecd3b

Please sign in to comment.