added functionality HardCacheDuration to config.ini
This commit is contained in:
parent
49f613ddeb
commit
8fe6783ecb
7 changed files with 52 additions and 73 deletions
21
init.go
21
init.go
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -43,8 +44,7 @@ func main() {
|
|||
}
|
||||
|
||||
loadNodeConfig()
|
||||
go startFileWatcher()
|
||||
go checkMasterHeartbeat()
|
||||
// go checkMasterHeartbeat() // Not currently used
|
||||
|
||||
if config.AuthCode == "" {
|
||||
config.AuthCode = generateStrongRandomString(64)
|
||||
|
@ -59,14 +59,17 @@ func main() {
|
|||
}
|
||||
config.PeerID = hostID
|
||||
|
||||
if len(config.Peers) > 0 {
|
||||
time.Sleep(2 * time.Second) // Give some time for connections to establish
|
||||
startElection()
|
||||
}
|
||||
// if len(config.Peers) > 0 {
|
||||
// time.Sleep(2 * time.Second) // Give some time for connections to establish
|
||||
// startElection()
|
||||
// }
|
||||
|
||||
if config.HardCacheDuration > 0 {
|
||||
config.HardCacheEnabled = true
|
||||
}
|
||||
// Start automatic update checker, not used now
|
||||
//go checkForUpdates()
|
||||
|
||||
generateOpenSearchXML(config)
|
||||
|
||||
log.Println("Hard cache:", config.HardCacheEnabled)
|
||||
|
||||
go startNodeClient()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue