Apply max-age header to bust PDF cache at midnight
Also update stylish-haskell config
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
||||
{-# LANGUAGE DeriveAnyClass #-}
|
||||
{-# LANGUAGE DeriveAnyClass #-}
|
||||
{-# LANGUAGE DuplicateRecordFields #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# OPTIONS_GHC -Wno-deriving-defaults #-}
|
||||
|
||||
module Yore.DB
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{-# LANGUAGE OverloadedRecordDot #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Yore.Index (createEntries) where
|
||||
|
||||
|
||||
+3
-4
@@ -1,13 +1,12 @@
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
{-# LANGUAGE OverloadedRecordDot #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Yore.Repl (connect, exec, getToday, indexDay, addYears) where
|
||||
|
||||
import Control.Exception (bracket, throwIO)
|
||||
import Control.Monad (forM)
|
||||
import Data.Time (Day)
|
||||
import Data.Time.LocalTime (getZonedTime, localDay, zonedTimeToLocalTime)
|
||||
import Data.Time (Day, getZonedTime, localDay, zonedTimeToLocalTime)
|
||||
import Text.Printf (printf)
|
||||
|
||||
import qualified Database.PostgreSQL.Opium as Opium
|
||||
|
||||
+6
-6
@@ -1,10 +1,10 @@
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE DuplicateRecordFields #-}
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
{-# LANGUAGE OverloadedRecordDot #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
{-# LANGUAGE ViewPatterns #-}
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
{-# LANGUAGE OverloadedRecordDot #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
{-# LANGUAGE ViewPatterns #-}
|
||||
|
||||
module Yore.Scrape (Issue (..), getIssuesByDay) where
|
||||
|
||||
|
||||
+17
-4
@@ -1,7 +1,16 @@
|
||||
module Yore.Time (addYears, getCurrentDay) where
|
||||
module Yore.Time (addYears, getCurrentDay, getSecondsUntilMidnight) where
|
||||
|
||||
import Data.Time (Day, addGregorianYearsClip, isLeapYear, toGregorian)
|
||||
import Data.Time.LocalTime (getZonedTime, localDay, zonedTimeToLocalTime)
|
||||
import Data.Time
|
||||
( Day
|
||||
, addGregorianYearsClip
|
||||
, getZonedTime
|
||||
, isLeapYear
|
||||
, localDay
|
||||
, localTimeOfDay
|
||||
, sinceMidnight
|
||||
, toGregorian
|
||||
, zonedTimeToLocalTime
|
||||
)
|
||||
|
||||
addYears :: Integer -> Day -> Maybe Day
|
||||
addYears yearOffset date
|
||||
@@ -18,5 +27,9 @@ addYears yearOffset date
|
||||
|
||||
getCurrentDay :: IO Day
|
||||
getCurrentDay = do
|
||||
print =<< getZonedTime
|
||||
localDay . zonedTimeToLocalTime <$> getZonedTime
|
||||
|
||||
getSecondsUntilMidnight :: IO Int
|
||||
getSecondsUntilMidnight = do
|
||||
timeOfDay <- localTimeOfDay . zonedTimeToLocalTime <$> getZonedTime
|
||||
pure $ 86400 - ceiling (sinceMidnight timeOfDay)
|
||||
|
||||
Reference in New Issue
Block a user