Add a warning when NoSnapshotFile

This commit is contained in:
Bryan Richter 2024-04-30 14:25:08 +03:00
parent 6bf160f210
commit d0eba4e31e
No known key found for this signature in database
GPG Key ID: B202264020068BFB

View File

@ -530,8 +530,7 @@ decideOnSnapshotUpdate SnapshotFileInfo {sfiSnapName, sfiUpdatedOn, sfiSnapshotF
run (getBy (UniqueSnapshot sfiSnapName)) >>= \case run (getBy (UniqueSnapshot sfiSnapName)) >>= \case
-- exists, up to date, no force-updated requested; nothing to do -- exists, up to date, no force-updated requested; nothing to do
Just (Entity _key snap) Just (Entity _key snap)
| snapshotUpdatedOn snap == Just sfiUpdatedOn && not forceUpdate -> do | snapshotUpdatedOn snap == Just sfiUpdatedOn && not forceUpdate ->
logInfo $ mkLogMsg "already exists and is up to date."
return NothingToDo return NothingToDo
-- exists but updatedOn was not previously set. -- exists but updatedOn was not previously set.
Just entity@(Entity _key snap) Just entity@(Entity _key snap)
@ -546,8 +545,8 @@ decideOnSnapshotUpdate SnapshotFileInfo {sfiSnapName, sfiUpdatedOn, sfiSnapshotF
Nothing -> maybe NoSnapshotFile DoesntExist <$> sfiSnapshotFileGetter Nothing -> maybe NoSnapshotFile DoesntExist <$> sfiSnapshotFileGetter
-- Add new snapshot to the database, when necessary -- Add new snapshot to the database, when necessary
case mKeySnapFile of case mKeySnapFile of
NothingToDo -> return Nothing NothingToDo -> Nothing <$ logInfo (mkLogMsg "already exists and is up to date.")
NoSnapshotFile -> return Nothing NoSnapshotFile -> Nothing <$ logWarn (mkLogMsg "has no (readable?) snapshot file.")
NeedsUpdate (Entity oldSnapKey oldSnap) sf@SnapshotFile {sfCompiler, sfPublishDate} NeedsUpdate (Entity oldSnapKey oldSnap) sf@SnapshotFile {sfCompiler, sfPublishDate}
| Just publishDate <- sfPublishDate -> do | Just publishDate <- sfPublishDate -> do
let updatedSnap = let updatedSnap =