diff --git a/backfill.sh b/backfill.sh index f79aa5b..9d55407 100755 --- a/backfill.sh +++ b/backfill.sh @@ -37,7 +37,7 @@ while IFS= read -r BACKUP_PATH; do sed -e 's|\("backup_read_root": \)".*"|\1"'"$BACKUP_PATH"'"|' "$SETTINGS_FILE" > "temp_$SETTINGS_FILE" # Run the Haskell program with the updated settings file - $PROG +RTS -N2 -RTS "temp_$SETTINGS_FILE" + time $PROG +RTS -N2 -RTS "temp_$SETTINGS_FILE" done < "$PATHS_FILE" # Optionally, remove the temporary settings file diff --git a/src/Backfill.hs b/src/Backfill.hs index 2b78489..aaddce0 100644 --- a/src/Backfill.hs +++ b/src/Backfill.hs @@ -226,7 +226,7 @@ processBoard settings board = do case result of Right catalogs -> do - let threads_on_board = concatMap threads catalogs + let threads_on_board = concatMap ((maybe [] id) . threads) catalogs all_threads_for_board :: [ Threads.Thread ] <- ensureThreads settings board threads_on_board diff --git a/src/JSONParsing.hs b/src/JSONParsing.hs index fe981ce..cf3bf19 100644 --- a/src/JSONParsing.hs +++ b/src/JSONParsing.hs @@ -42,7 +42,7 @@ instance FromJSON Thread --instance ToJSON Thread data Catalog = Catalog - { threads :: [Thread] + { threads :: Maybe [Thread] , page :: Int } deriving (Show, Generic)