Commits

John Floren committed 9355d3b

Fixed long-standing bug where the database and collection specified in the config file were only used once, and hard-coded values were used elsewhere.

  • Participants
  • Parent commits 75a639a

Comments (0)

Files changed (1)

 
 func UpdatePeople() {
 	if session != nil {
-		c := session.DB("megadroid").C("phones")
+		c := session.DB(config.Database).C(config.Collection)
 		for _, p := range people {
 			fmt.Printf("updating %v\n", p)
 			_, err := c.Upsert(bson.M{"uid": p.UID}, &DBPerson{p.UID, p.Loc().Lat, p.Loc().Lon})
 // it's quite likely that the UID you're asking about will be simulated on a different computer
 func HandlePos(c *net.TCPConn, args []string) {
 	if args != nil {
-		db := session.DB("megadroid").C("phones")
+		db := session.DB(config.Database).C(config.Collection)
 		fmt.Printf("arguments = %v\n", args)
 		uid := args[0]
 		result := &DBPerson{}