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