on master help sign in
Fix: work with newer stm
commit22ee0e1a6bce09fc40ae781e6f27b6392c4819b2 authorAleksey Uimanov <s9gf4ult@gmail.com> dateFri 12 Jul 2019, 22:01 (7 years ago) parent948052a
5 files changed+45−8
katip-datadog/src/Katip/Scribes/Datadog/TCP.hs+1−1 katip/katip.cabal+3−2 katip/src/Katip/Scribes/Handle/FileOwner.hs+15−4 stack-old.yaml+21 stack.yaml+5−1
katip-datadog/src/Katip/Scribes/Datadog/TCP.hs+1−1
@@ -33,8 +33,8 @@ import qualified Data.Text.Lazy.Builder as B
3333import Data.Time (NominalDiffTime)
3434import Katip
3535import Katip.Core (LocJs (..))
36−import qualified Network as Net
3736import qualified Network.Connection as C
37+import qualified Network.Socket as Net
3838import qualified System.Posix.Types as POSIX
3939-------------------------------------------------------------------------------
4040
katip/katip.cabal+3−2
@@ -43,7 +43,8 @@ library
4343 , Katip.Scribes.Handle
4444 , Katip.Scribes.Handle.FileOwner
4545
46− default-extensions: DeriveGeneric
46+ default-extensions: CPP
47+ , DeriveGeneric
4748 , FlexibleContexts
4849 , GeneralizedNewtypeDeriving
4950 , LambdaCase
@@ -72,7 +73,7 @@ library
7273 , safe-exceptions >= 0.1.0.0
7374 , scientific >= 0.3.3.0
7475 , semigroups
75− , stm >= 2.4 && < 2.5
76+ , stm >= 2.4
7677 , string-conv >= 0.1
7778 , template-haskell >= 2.8
7879 , text >= 0.11
katip/src/Katip/Scribes/Handle/FileOwner.hs+15−4
@@ -14,6 +14,11 @@ import GHC.IO.Handle
1414import GHC.IO.Handle.FD
1515import GHC.IO.IOMode
1616
17+#if MIN_VERSION_stm(2,5,0)
18+import Numeric.Natural
19+#endif
20+
21+
1722-- | File owner struct writing data to the file
1823-- sequentially. Automatic buffer flushing and log rotating.
1924data FileOwner = FileOwner
@@ -23,16 +28,22 @@ data FileOwner = FileOwner
2328 -- ^ Wait for to be sure that worker thread is closed.
2429 }
2530
31+#if MIN_VERSION_stm(2,5,0)
32+type QueueLen = Natural
33+#else
34+type QueueLen = Int
35+#endif
36+
2637data FileOwnerSettings = FileOwnerSettings
2738 { fosDebounceFreq :: Maybe Int
28− , fosDataQueueLen :: Int
29− , fosControlQueueLen :: Int
39+ , fosDataQueueLen :: QueueLen
40+ , fosControlQueueLen :: QueueLen
3041 }
3142
3243defaultFileOwnerSettings :: FileOwnerSettings
3344defaultFileOwnerSettings = FileOwnerSettings
34− { fosDebounceFreq = Just 200000 -- every 200ms
35− , fosDataQueueLen = 1000
45+ { fosDebounceFreq = Just 200000 -- every 200ms
46+ , fosDataQueueLen = 1000
3647 , fosControlQueueLen = 100
3748 }
3849
stack-old.yamlnew file+21
@@ -0,0 +1,21 @@
1+nix:
2+ packages:
3+ - zlib
4+resolver: lts-12.26
5+packages:
6+ - katip
7+ - katip-elasticsearch
8+ - katip-datadog
9+ - katip-logzio
10+extra-deps:
11+ - bloodhound-0.16.0.0
12+ - unliftio-core-0.1.2.0
13+flags:
14+ katip:
15+ lib-Werror: true
16+ katip-elasticsearch:
17+ lib-Werror: true
18+ katip-datadog:
19+ lib-Werror: true
20+ katip-logzio:
21+ lib-Werror: true
stack.yaml+5−1
@@ -1,14 +1,18 @@
11nix:
22 packages:
33 - zlib
4−resolver: lts-12.26
4+resolver: lts-13.21
55packages:
66 - katip
77 - katip-elasticsearch
88 - katip-datadog
99 - katip-logzio
1010extra-deps:
11+ - binary-0.8.7.0
1112 - bloodhound-0.16.0.0
13+ - containers-0.5.11.0
14+ - hedgehog-1.0
15+ - tasty-hedgehog-1.0.0.1
1216 - unliftio-core-0.1.2.0
1317flags:
1418 katip: