Fix potentially having a null in the creation time of the sql query

This commit is contained in:
towards-a-new-leftypol 2025-02-14 10:23:36 -05:00
parent 4dd29a72b6
commit dd0f554eb8
2 changed files with 8 additions and 2 deletions

View File

@ -14,7 +14,7 @@ data GetLatestPostsPerBoardResponse = GetLatestPostsPerBoardResponse
, pathpart :: String
-- , post_id :: Maybe Int64
-- , board_post_id :: Int64
, creation_time :: UTCTime
, creation_time :: Maybe UTCTime
-- , thread_id :: Int64
-- , board_thread_id :: Integer
} deriving (Show, Generic, FromJSON)

View File

@ -174,7 +174,13 @@ syncWebsites csmr_settings = do
let board_id_to_last_modified = Map.fromList $
map
(\b -> (GLPPBR.board_id b, GLPPBR.creation_time b))
( \b ->
( GLPPBR.board_id b
-- set t = 0 if there are no posts on the board yet
-- this way it will check all of the threads
, fromMaybe (Lib.epochToUTCTime 0) $ GLPPBR.creation_time b
)
)
latest_posts_per_board
let site_name_to_site :: Map.Map String Site.Site =