From ec7ff033b01858dc42ed2cd1727d0cd10b72cb71 Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 27 Nov 2023 19:06:03 +0100 Subject: [PATCH] Be nice to the package server --- src/scripts/Setup.elm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/scripts/Setup.elm b/src/scripts/Setup.elm index 93f7a2a..3405391 100644 --- a/src/scripts/Setup.elm +++ b/src/scripts/Setup.elm @@ -6,6 +6,7 @@ import Docs.Package.Cache as Cache import Generate import Http import Json.Decode as Decode +import Process import Set import Task @@ -92,8 +93,17 @@ fetchDocs elmVersion metadata = decoder = Package.decode elmVersion metadata in - Http.get url decoder - |> Http.send (ensureOk Response) + Process.sleep 100 + |> Task.andThen + (\_ -> + Http.get url decoder + |> Http.toTask + ) + |> Task.attempt (ensureOk Response) + + + +--|> Http.send (ensureOk Response) cacheModule : Package.Package -> Cmd msg