Easier files
This commit is contained in:
1 parent
6e35445090
commit
05263fed2b
2 files changed
+4
-2
No files matched your search
@@ -6,6 +6,8 @@ dist-newstyle
|
|||||||
|
|
||||||
docs/superpowers/plans
|
docs/superpowers/plans
|
||||||
|
|
||||||
|
*.dat
|
||||||
|
handlers.json
|
||||||
*.hp
|
*.hp
|
||||||
*.eventlog
|
*.eventlog
|
||||||
*.eventlog.html
|
*.eventlog.html
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ import HttpServer qualified
|
|||||||
import Katip (KatipContext, Namespace (Namespace), Severity (..), logF, logLocM, ls, runKatipContextT, runKatipT, sl, katipAddNamespace)
|
import Katip (KatipContext, Namespace (Namespace), Severity (..), logF, logLocM, ls, runKatipContextT, runKatipT, sl, katipAddNamespace)
|
||||||
import Network.Socket (withSocketsDo)
|
import Network.Socket (withSocketsDo)
|
||||||
import System.Environment (getEnv, lookupEnv)
|
import System.Environment (getEnv, lookupEnv)
|
||||||
import System.FilePath ((</>))
|
import System.FilePath ((</>), (<.>))
|
||||||
import System.Metrics qualified
|
import System.Metrics qualified
|
||||||
import Text.Read (readMaybe)
|
import Text.Read (readMaybe)
|
||||||
import UnliftIO.Async
|
import UnliftIO.Async
|
||||||
@@ -81,7 +81,7 @@ runController :: forall m. (HasCallStack, MonadCatch m, KatipContext m, MonadIO
|
|||||||
runController rootDir bus (Controller name machine) = checkpoint (Annotation name) $ katipAddNamespace ns $ do
|
runController rootDir bus (Controller name machine) = checkpoint (Annotation name) $ katipAddNamespace ns $ do
|
||||||
inbound <- liftIO $ atomically (dupTChan (busInbound bus))
|
inbound <- liftIO $ atomically (dupTChan (busInbound bus))
|
||||||
let workerDefinition = runMealy machine (channelHassEval @m bus)
|
let workerDefinition = runMealy machine (channelHassEval @m bus)
|
||||||
let path = rootDir </> T.unpack name
|
let path = rootDir </> T.unpack name <.> "dat"
|
||||||
worker <-
|
worker <-
|
||||||
load path workerDefinition >>= \case
|
load path workerDefinition >>= \case
|
||||||
Decoded a -> pure a
|
Decoded a -> pure a
|
||||||
|
|||||||
Reference in new issue
Block a user