This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- TLP 1.1 -------------------------------------------- | |
+++ Configured Settings: /etc/default/tlp | |
TLP_ENABLE=1 | |
TLP_DEFAULT_MODE=AC | |
TLP_PERSISTENT_DEFAULT=0 | |
DISK_IDLE_SECS_ON_AC=0 | |
DISK_IDLE_SECS_ON_BAT=2 | |
MAX_LOST_WORK_SECS_ON_AC=15 | |
MAX_LOST_WORK_SECS_ON_BAT=15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- TLP 1.1 -------------------------------------------- | |
+++ Configured Settings: /etc/default/tlp | |
TLP_ENABLE=1 | |
TLP_DEFAULT_MODE=AC | |
TLP_PERSISTENT_DEFAULT=0 | |
DISK_IDLE_SECS_ON_AC=0 | |
DISK_IDLE_SECS_ON_BAT=2 | |
MAX_LOST_WORK_SECS_ON_AC=15 | |
MAX_LOST_WORK_SECS_ON_BAT=15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type TreeModel struct { | |
//Comment is the left one | |
Comment commentModel `bson:",inline"` | |
User userModel `bson:"user"` | |
} | |
func FindPiped(pipes *[]bson.M, tree documents.DocumentTreesInterface) error { | |
s := mgoSession.Clone() | |
defer s.Close() | |
iter := s.DB(db).C(collection).Pipe(*pipes).Iter() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"gopkg.in/mgo.v2/bson" | |
"time" | |
"gopkg.in/mgo.v2" | |
"log" | |
) | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func main(){ | |
model := SomeModel{} | |
// listen and wait for changes | |
// block till new data arrived | |
err := mongo.ListenForNewData(bson.ObjectIdHex("58b84ea573e0b074e4e7a837"),&model) | |
// free | |
// do something with the model | |
} | |
func ListenForNewData(lastId bson.ObjectId,doc interface{}) error { |