summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkfine <>2018-05-15 05:23:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-05-15 05:23:00 (GMT)
commitb26ee4ce7b4bbedf785621915039c74d190927f1 (patch)
tree8fc73b43998cad7bf0aeed7967e16f0e3ee16f44
parentd7cb593dd0040f6b68f9bc57ea661c1ca578a783 (diff)
version 0.3.45HEAD0.3.45master
-rw-r--r--src/Network/AWS/Wolf/Act.hs3
-rw-r--r--src/Network/AWS/Wolf/File.hs10
-rw-r--r--wolf.cabal2
3 files changed, 14 insertions, 1 deletions
diff --git a/src/Network/AWS/Wolf/Act.hs b/src/Network/AWS/Wolf/Act.hs
index 913b04f..4356d8f 100644
--- a/src/Network/AWS/Wolf/Act.hs
+++ b/src/Network/AWS/Wolf/Act.hs
@@ -95,12 +95,15 @@ act queue nocopy local includes command =
sd <- storeDirectory wd
isd <- inputDirectory sd
osd <- outputDirectory sd
+ msd <- metaDirectory sd
writeJson (dd </> "control.json") (Control uid')
writeText (dd </> "input.json") input
+ writeText (msd </> (textToString queue <> "_input.json")) input
download isd includes
e <- run command
upload osd
output <- readText (dd </> "output.json")
+ writeText (msd </> (textToString queue <> "_output.json")) output
maybe (completeActivity token' output) (const $ failActivity token') e
t3 <- liftIO getCurrentTime
traceInfo "finish" [ "dir" .= wd ]
diff --git a/src/Network/AWS/Wolf/File.hs b/src/Network/AWS/Wolf/File.hs
index 5396662..5b87ef2 100644
--- a/src/Network/AWS/Wolf/File.hs
+++ b/src/Network/AWS/Wolf/File.hs
@@ -8,6 +8,7 @@ module Network.AWS.Wolf.File
, storeDirectory
, inputDirectory
, outputDirectory
+ , metaDirectory
, writeText
, readText
, writeJson
@@ -56,6 +57,15 @@ outputDirectory dir = do
liftIO $ createDirectoryIfMissing True dir'
pure dir'
+-- | Determine path to store input/output json files and create it.
+--
+metaDirectory :: MonadIO m => FilePath -> m FilePath
+metaDirectory dir = do
+ osd <- outputDirectory dir
+ let dir' = osd </> "meta"
+ liftIO $ createDirectoryIfMissing True dir'
+ pure dir'
+
-- | Maybe write text to a file.
--
writeText :: MonadIO m => FilePath -> Maybe Text -> m ()
diff --git a/wolf.cabal b/wolf.cabal
index 4001f4a..a3ead1b 100644
--- a/wolf.cabal
+++ b/wolf.cabal
@@ -1,6 +1,6 @@
cabal-version: >=1.22
name: wolf
-version: 0.3.44
+version: 0.3.45
license: MIT
license-file: LICENSE
copyright: Copyright (C) 2015-2016 Swift Navigation, Inc.