on master help sign in
Default index sharding to daily

I don't want to create a tyranny of the default situation, and I'd argue that defaulting to NoIndexSharding is irresponsible because it is almost entirely unsuitable to production use. Better to rip the band-aid off now while we are the only users.

commitf3738df1f0633f4e4808e65491a5475db2d5a541 authorMichael Xavier <michael@michaelxavier.net> dateMon 29 Feb 2016, 16:34 (11 years ago) parent0fb40b6
2 files changed+4−4
katip-elasticsearch/src/Katip/Scribes/ElasticSearch.hs+2−2 katip-elasticsearch/test/Main.hs+2−2
katip-elasticsearch/src/Katip/Scribes/ElasticSearch.hs+2−2
@@ -101,7 +101,7 @@ data EsScribeCfg = EsScribeCfg {
101101--
102102-- * Annotate types set to False
103103--
104−-- * NoIndexSharding
104+-- * DailyIndexSharding
105105defaultEsScribeCfg :: EsScribeCfg
106106defaultEsScribeCfg = EsScribeCfg {
107107 essManagerSettings = defaultManagerSettings
@@ -110,7 +110,7 @@ defaultEsScribeCfg = EsScribeCfg {
110110 , essPoolSize = EsPoolSize 2
111111 , essAnnotateTypes = False
112112 , essIndexSettings = defaultIndexSettings
113− , essIndexSharding = NoIndexSharding
113+ , essIndexSharding = DailyIndexSharding
114114 }
115115
116116
katip-elasticsearch/test/Main.hs+2−2
@@ -78,7 +78,7 @@ withSearch' modScribeCfg = withResource (setupSearch modScribeCfg) teardownSearc
7878esTests :: TestTree
7979esTests = testGroup "elasticsearch scribe"
8080 [
81− withSearch $ \setup -> testCase "it flushes to elasticsearch" $ withTestLogging setup $ \done -> do
81+ withSearch' (\c -> c { essIndexSharding = NoIndexSharding}) $ \setup -> testCase "it flushes to elasticsearch" $ withTestLogging setup $ \done -> do
8282 $(logT) (ExampleCtx True) mempty InfoS "A test message"
8383 liftIO $ do
8484 void done
@@ -87,7 +87,7 @@ esTests = testGroup "elasticsearch scribe"
8787 let l = head logs
8888 l ^? key "_source" . key "msg" . _String @?= Just "A test message"
8989 l ^? key "_source" . key "data" . key "whatever::b" . _Bool @?= Just True
90− , withSearch' (\c -> c { essIndexSharding = DailyIndexSharding}) $ \setup -> testCase "date-based index sharding" $ do
90+ , withSearch $ \setup -> testCase "date-based index sharding" $ do
9191 let t1 = mkTime 2016 1 2 3 4 5
9292 fakeClock <- newTVarIO t1
9393 withTestLogging' (set logEnvTimer (readTVarIO fakeClock)) setup $ \done -> do