Giter VIP home page Giter VIP logo

go-plag's People

Contributors

sohlich avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

go-plag's Issues

feature: bulk upsert for inserting comaprison results

The bulk api of mgo driver does not support bulk upserts. The feature is planned for next releases of mgo. After the feature is available. The upsert/update of comparison results will be modified.
The code seems to be working, but the result of Run is error

DEBU[0079] map[ok:0 errmsg:no such cmd: updates code:59 bad cmd:map[updates:[map[upsert:true q:map[_id:55d9451ee13823205f00006a] u:map[$pull:map[similarities:map[id:55d944d9e13823205f00000f]]] multi:true] map[u:map[$push:map[similarities:map[val:0.30000001192092896 id:55d944d9e13823205f00000f]]] multi:true upsert:true q:map[_id:55d9451ee13823205f00006a]]] update:results]] 
ERRO[0079] no such cmd: updates     
     bulk2 := bson.M{"update": m.ResultCollection, "updates": []bson.M{
            {"q": file2Query,
                "u":      file2Pull,
                "multi":  true,
                "upsert": true,
            },
            {"q": file2Query,
                "u":      file2Update,
                "multi":  true,
                "upsert": true,
            }}}
err = m.db.Run(bulk2, &result)

test: solve data race at TestPutSubmission (plag_routes_test: 86)

WARNING: DATA RACE
Write by goroutine 31:
github.com/sohlich/go-plag.TestPutSubmission.func1()
/home/radek/Projekty/Go/src/github.com/sohlich/go-plag/plag_routes_test.go:73 +0x30
github.com/sohlich/go-plag.TestPutSubmission()
/home/radek/Projekty/Go/src/github.com/sohlich/go-plag/plag_routes_test.go:87 +0x4ec
testing.tRunner()
/tmp/workdir/go/src/testing/testing.go:456 +0xdc

Previous read by goroutine 34:
github.com/sohlich/go-plag.syncWithApac()
/home/radek/Projekty/Go/src/github.com/sohlich/go-plag/plag_apac.go:11 +0x76
github.com/sohlich/go-plag.checkAssignment()
/home/radek/Projekty/Go/src/github.com/sohlich/go-plag/plag_compare.go:107 +0x6f7
github.com/sohlich/go-plag.putSubmission.func1()
/home/radek/Projekty/Go/src/github.com/sohlich/go-plag/plag_routes.go:70 +0x8a

Goroutine 31 (running) created at:
testing.RunTests()
/tmp/workdir/go/src/testing/testing.go:561 +0xaa3
testing.(*M).Run()
/tmp/workdir/go/src/testing/testing.go:494 +0xe4
main.main()
github.com/sohlich/go-plag/_test/_testmain.go:86 +0x20f

Goroutine 34 (finished) created at:
github.com/sohlich/go-plag.putSubmission()
/home/radek/Projekty/Go/src/github.com/sohlich/go-plag/plag_routes.go:76 +0x9ec
github.com/gin-gonic/gin.(_Context).Next()
/home/radek/Projekty/Go/src/github.com/gin-gonic/gin/context.go:95 +0x145
github.com/gin-gonic/gin.(_Engine).handleHTTPRequest()
/home/radek/Projekty/Go/src/github.com/gin-gonic/gin/gin.go:294 +0x405
github.com/gin-gonic/gin.(*Engine).ServeHTTP()
/home/radek/Projekty/Go/src/github.com/gin-gonic/gin/gin.go:275 +0x2e8
github.com/sohlich/go-plag.TestPutSubmission()
/home/radek/Projekty/Go/src/github.com/sohlich/go-plag/plag_routes_test.go:82 +0x3da
testing.tRunner()
/tmp/workdir/go/src/testing/testing.go:456 +0xdc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.