mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-03 12:18:09 +08:00
[REV] add log
This commit is contained in:
parent
641f395a31
commit
746abc5dcc
@ -25,6 +25,8 @@ import (
|
|||||||
"github.com/jinzhu/gorm"
|
"github.com/jinzhu/gorm"
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
"github.com/Sirupsen/logrus"
|
||||||
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -51,6 +53,8 @@ func (c *EventDaoImpl) UpdateModel(mo model.Interface) error {
|
|||||||
var oldResult model.ServiceEvent
|
var oldResult model.ServiceEvent
|
||||||
if ok := c.DB.Where("event_id=?", result.EventID).Find(&oldResult).RecordNotFound(); !ok {
|
if ok := c.DB.Where("event_id=?", result.EventID).Find(&oldResult).RecordNotFound(); !ok {
|
||||||
finalUpdateEvent(result,&oldResult)
|
finalUpdateEvent(result,&oldResult)
|
||||||
|
b,_:=json.Marshal(oldResult)
|
||||||
|
logrus.Infof("saving to even %s",string(b))
|
||||||
if err := c.DB.Save(oldResult).Error; err != nil {
|
if err := c.DB.Save(oldResult).Error; err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -291,20 +291,13 @@ func (h *handleMessageStore) handleBarrelEvent() {
|
|||||||
webhook.GetManager().RunWebhookWithParameter(webhook.UpDateEventStatus, nil,
|
webhook.GetManager().RunWebhookWithParameter(webhook.UpDateEventStatus, nil,
|
||||||
map[string]interface{}{"event_id": eventID, "status": status, "message": message})
|
map[string]interface{}{"event_id": eventID, "status": status, "message": message})
|
||||||
//todo update db
|
//todo update db
|
||||||
for k:=0;k<100;k++{
|
|
||||||
logrus.Infof("-------------------callbacking")
|
|
||||||
logrus.Infof("-------------------callbacking")
|
|
||||||
logrus.Infof("-------------------callbacking")
|
|
||||||
logrus.Infof("-------------------callbacking")
|
|
||||||
logrus.Infof("-------------------callbacking")
|
|
||||||
logrus.Infof("-------------------callbacking")
|
|
||||||
logrus.Infof("-------------------callbacking")
|
|
||||||
}
|
|
||||||
|
|
||||||
event:=model.ServiceEvent{}
|
event:=model.ServiceEvent{}
|
||||||
event.EventID=eventID
|
event.EventID=eventID
|
||||||
event.Status=status
|
event.Status=status
|
||||||
event.Message=message
|
event.Message=message
|
||||||
|
|
||||||
|
logrus.Infof("-----------%s",status)
|
||||||
cdb.GetManager().EventLogDao().UpdateModel(&event)
|
cdb.GetManager().EventLogDao().UpdateModel(&event)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user