Fix RunID in case of default session

This commit is contained in:
DanB
2016-08-26 08:51:25 +02:00
parent f7ca7b400f
commit 3b9756a9b4

View File

@@ -592,6 +592,7 @@ func (self *SMGeneric) getSessions() map[string][]*SMGSession {
}
func (self *SMGeneric) ActiveSessions(fltrs map[string]string) (aSessions []*ActiveSession, err error) {
aSessions = make([]*ActiveSession, 0) // Make sure we return at least empty list and not nil
// Check first based on indexes so we can downsize the list of matching sessions
matchingSessionIDs, checkedFilters := self.getSessionIDsMatchingIndexes(fltrs)
if len(matchingSessionIDs) == 0 && len(checkedFilters) != 0 {
@@ -617,6 +618,9 @@ func (self *SMGeneric) ActiveSessions(fltrs map[string]string) (aSessions []*Act
if err != nil {
return nil, err
}
if _, hasRunID := sMp[utils.MEDI_RUNID]; !hasRunID {
sMp[utils.MEDI_RUNID] = utils.META_DEFAULT
}
matchingAll := true
for fltrFldName, fltrFldVal := range fltrs {
if fldVal, hasIt := sMp[fltrFldName]; !hasIt || fltrFldVal != fldVal { // No Match