File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 7
7
let msgSource = Actors.messageSource typeof< KillImportActor>. Name
8
8
let logException ( ex : Exception ) = ex.Message |> msgSource |> ActorMessage.Error |> log
9
9
let logInfo = msgSource >> ActorMessage.Info >> log
10
- let dbCollection =
11
- sprintf " Initialising DB connection to %s %s .%s ..." config.MongoServer config.DbName config.KillsDbCollection |> logInfo
12
- MongoDb.killsCollection config.MongoServer config.DbName config.KillsDbCollection config.MongoUserName config.MongoPassword
13
-
10
+
11
+
14
12
let insertOne ( col : IMongoCollection < Object >) doc =
15
13
col.InsertOne( doc)
16
14
17
- let write = insertOne dbCollection
18
-
15
+ let write =
16
+ if not config.NoCache then
17
+ let dbCollection =
18
+ sprintf " Initialising DB connection to %s %s .%s ..." config.MongoServer config.DbName config.KillsDbCollection |> logInfo
19
+ MongoDb.killsCollection config.MongoServer config.DbName config.KillsDbCollection config.MongoUserName config.MongoPassword
20
+
21
+ insertOne dbCollection
22
+ else
23
+ ignore
24
+
19
25
let pipe = MessageInbox.Start( fun inbox ->
20
26
let rec loop () = async {
21
27
You can’t perform that action at this time.
0 commit comments