Skip to content

Commit

Permalink
fetch stores concurrently
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoog committed May 26, 2024
1 parent 8066e25 commit 92618ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Main.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Main where

import Control.Concurrent.Async (mapConcurrently_)
import Control.Monad
import Data.ByteString.Lazy (ByteString)
import Data.ByteString.Lazy qualified as L
Expand Down Expand Up @@ -53,7 +54,7 @@ handleArgs ["fetch"] = do
, "546" -- NYC East Village
, "452" -- Austin Seaholm
]
mapM_ (scrapeStore conn) stores
mapConcurrently_ (scrapeStore conn) stores
printlog "done"
changeCount <- SQL.totalChanges conn
printlog $ "changed rows: " <> show changeCount
Expand Down
1 change: 1 addition & 0 deletions traderjoes.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ executable traderjoes
ghc-options: -Wall -Werror
build-depends: base
, aeson
, async
, blaze-html
, blaze-markup
, bytestring
Expand Down

0 comments on commit 92618ef

Please sign in to comment.