[FIX] fix Possible out of range error

This commit is contained in:
bay1ts 2017-12-05 11:49:59 +08:00
parent cb56e1591e
commit b0d9102e83

View File

@ -313,24 +313,25 @@ func (h *handleMessageStore) handleBarrelEvent() {
event.CodeVersion = codeVersion
cdb.GetManager().ServiceEventDao().UpdateModel(&event)
version,_:=cdb.GetManager().VersionInfoDao().GetVersionByEventID(eventID)
infos:=strings.Split(codeVersion,":")
for k,v:=range infos{
i:=strings.Split(v," ")
if k==0 {
}
if k==1 {
version.CodeVersion=i[0]
}
if k==2 {
version.Author=i[0]
}
if k == 3 {
version.CommitMsg=v
}
}
//infos:=strings.Split(codeVersion,":")
version.CodeVersion=codeVersion
//for k,v:=range infos{
// i:=strings.Split(v," ")
// if k==0 {
//
// }
// if k==1 {
// version.CodeVersion=i[0]
//
// }
// if k==2 {
// version.Author=i[0]
//
// }
// if k == 3 {
// version.CommitMsg=v
// }
//}
cdb.GetManager().VersionInfoDao().UpdateModel(version)
h.log.Infof("run web hook update code version .event_id %s code_version %s", eventID, codeVersion)
}