Skip to content

Commit

Permalink
Fixing of issue #296 "Reloading is broken in v2.1 with rotate-logs: T…
Browse files Browse the repository at this point in the history
…rue"
  • Loading branch information
ktak-007 committed Feb 15, 2025
1 parent 206b5d2 commit 0cd5152
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Keter/App.hs
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,14 @@ withLogger aid (Just var) f = do
mappLogger <- liftIO $ readTVarIO var
case mappLogger of
Nothing -> withRunInIO $ \rio ->
bracketOnError (Log.createLoggerViaConfig ascKeterConfig (appLogName aid)) Log.loggerClose (rio . f var)
bracketOnError (Log.createLoggerViaConfig ascKeterConfig (appLogName aid))
Log.loggerClose
$ saveLoggerAndRun (rio . f var)
Just appLogger -> f var appLogger
where
saveLoggerAndRun f' appLogger = do
atomically $ writeTVar var $ Just appLogger
f' appLogger

withSanityChecks :: BundleConfig -> KeterM AppStartConfig a -> KeterM AppStartConfig a
withSanityChecks BundleConfig{..} f = do
Expand Down

0 comments on commit 0cd5152

Please sign in to comment.