Skip to content

Commit

Permalink
Merge pull request #5 from jameson2011/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jameson2011 authored Jun 11, 2020
2 parents 79311eb + 5fb4fe5 commit 4396b80
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
6 changes: 0 additions & 6 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,19 @@ let publishAndCopy runtime =

Shell.copyDir targetDir sourceDir (fun _ -> true)

Target.create "PublishRuntime-ubuntu-arm" (fun _ -> publishAndCopy "ubuntu-arm")
Target.create "PublishRuntime-ubuntu-arm64" (fun _ -> publishAndCopy "ubuntu-arm64")
Target.create "PublishRuntime-ubuntu-x64" (fun _ -> publishAndCopy "ubuntu-x64")
Target.create "PublishRuntime-win-x86" (fun _ -> publishAndCopy "win-x86")
Target.create "PublishRuntime-win-arm" (fun _ -> publishAndCopy "win-arm")
Target.create "PublishRuntime-linux-arm" (fun _ -> publishAndCopy "linux-arm")
Target.create "PublishRuntime-linux-arm64" (fun _ -> publishAndCopy "linux-arm64")


Target.create "All" ignore

"Clean"
==> "Build"
==> "PublishRuntime-ubuntu-arm"
==> "PublishRuntime-ubuntu-arm64"
==> "PublishRuntime-ubuntu-x64"
==> "PublishRuntime-win-x86"
==> "PublishRuntime-win-arm"
==> "PublishRuntime-linux-arm"
==> "PublishRuntime-linux-arm64"
==> "All"

Expand Down
2 changes: 1 addition & 1 deletion src/zKbProxy/KillProviderActor.fs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type KillProviderActor(log: PostMessage, stats: PostMessage, config: Configurati
let getKillCount()=
async {
try
return! (dbCollection.CountAsync(fun _ -> true) |> Async.AwaitTask)
return! (dbCollection.CountDocumentsAsync(fun _ -> true) |> Async.AwaitTask)
with
| e -> logException e
return 0L
Expand Down
8 changes: 4 additions & 4 deletions src/zKbProxy/MongoDb.fs
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@
let setIndex (path: string) (collection: IMongoCollection<'a>) =
let json = sprintf "{'%s': 1 }" path
let def = IndexKeysDefinition<'a>.op_Implicit(json)
let model = CreateIndexModel<'a>(def)
let r = collection.Indexes.CreateOne(model)

let r = collection.Indexes.CreateOne(def)

collection

let getCollection colName (db: IMongoDatabase) =
Expand All @@ -113,14 +113,14 @@
initCollection "" server dbName collectionName userName password

let upsert (collection: IMongoCollection<BsonDocument>) (doc: BsonDocument) =
let opts = UpdateOptions()
let opts = ReplaceOptions()
opts.IsUpsert <- true

let filter = doc |> Bson.getId
|> idFilter |> Bson.ofJson
|> FilterDefinition.op_Implicit
collection.ReplaceOne(filter, doc, opts) |> ignore


let delete (collection: IMongoCollection<BsonDocument>) id =

let filter = id |> idFilter |> Bson.ofJson
Expand Down

0 comments on commit 4396b80

Please sign in to comment.