InitServerState initializes this server's state.
()
| 61 | |
| 62 | // InitServerState initializes this server's state. |
| 63 | func InitServerState() { |
| 64 | Config.validate() |
| 65 | |
| 66 | State.FinishCh = make(chan struct{}) |
| 67 | State.needTs = make(chan tsReq, 100) |
| 68 | |
| 69 | State.InitStorage() |
| 70 | go State.fillTimestampRequests() |
| 71 | |
| 72 | groupId, err := x.ReadGroupIdFile(Config.PostingDir) |
| 73 | if err != nil { |
| 74 | glog.Warningf("Could not read %s file inside posting directory %s.", x.GroupIdFileName, |
| 75 | Config.PostingDir) |
| 76 | } |
| 77 | x.WorkerConfig.ProposedGroupId = groupId |
| 78 | } |
| 79 | |
| 80 | func setBadgerOptions(opt badger.Options) badger.Options { |
| 81 | opt = opt.WithSyncWrites(false). |
no test coverage detected