Logging expire & Bugfix

**** Not done yet ****
+ Bugfix: The data of the startup ICCC message was not proper set
+ Changed the logging expire
This commit is contained in:
Thorsten 2014-11-07 17:31:21 +01:00
parent e28999e15f
commit 9189f92432
2 changed files with 6 additions and 7 deletions

View File

@ -58,14 +58,12 @@ func initDatabase() {
// //
indexTimeUTC := mgo.Index{} indexTimeUTC := mgo.Index{}
indexTimeUTC.Key = []string{`TimeUTC`} indexTimeUTC.Key = []string{`TimeUTC`}
logDBCollection.EnsureIndex(indexTimeUTC)
if expire { if expire {
indexTTL := mgo.Index{} indexTimeUTC.ExpireAfter = time.Duration(expireAfterDays*24) * time.Hour
indexTTL.Key = []string{`TimeUTC`} } else {
indexTTL.ExpireAfter = time.Duration(expireAfterDays) * time.Hour * 24 indexTimeUTC.ExpireAfter = time.Duration(0)
logDBCollection.EnsureIndex(indexTTL)
} }
logDBCollection.EnsureIndex(indexTimeUTC)
indexProject := mgo.Index{} indexProject := mgo.Index{}
indexProject.Key = []string{`Project`} indexProject.Key = []string{`Project`}

View File

@ -11,7 +11,6 @@ func Start() {
// Tell the whole cluster, that we are up and ready: // Tell the whole cluster, that we are up and ready:
data := SystemMessages.ICCCStartUpMessage{} data := SystemMessages.ICCCStartUpMessage{}
defer ICCC.WriteMessage2All(ICCC.ChannelSYSTEM, `System::Start`, data)
if serverPublic != nil { if serverPublic != nil {
data.PublicIPAddressAndPort = serverPublicAddressPort data.PublicIPAddressAndPort = serverPublicAddressPort
@ -24,4 +23,6 @@ func Start() {
Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameSTARTUP, `Admin web server is now listening.`, `Configuration for hostname and port.`, serverAdminAddressPort) Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameSTARTUP, `Admin web server is now listening.`, `Configuration for hostname and port.`, serverAdminAddressPort)
go serverAdmin.ListenAndServe() go serverAdmin.ListenAndServe()
} }
ICCC.WriteMessage2All(ICCC.ChannelSYSTEM, `System::Start`, data)
} }