no message

master
DESKTOP-4RNDQIC\29019 2021-07-21 00:14:05 +08:00
parent 4581b21970
commit 14b902f429
3 changed files with 13 additions and 14 deletions

View File

@ -191,9 +191,9 @@ func (this *PlanController) FinishUndo(c *gin.Context) {
id := c.Param("id")
log.Print("finish undo id",id)
e := db.GetOrm().Exec(fmt.Sprintf("update background.`undo` set done = 1,finish_time='%s' where id = %d",
time.Now().Format("2006-01-02 15:04:05"),1)).Error
log.Print(fmt.Sprintf("update undo set done = 1,finish_time='%s' where id = %d",time.Now().Format("2006-01-02 15:04:05"),1))
e := db.GetOrm().Exec(fmt.Sprintf("update background.`undo` set done = 1,finish_time='%s' where id = %s",
time.Now().Format("2006-01-02 15:04:05"),id)).Error
log.Print(fmt.Sprintf("update background.`undo` set done = 1,finish_time='%s' where id = %s",time.Now().Format("2006-01-02 15:04:05"),id))
if nil != e {
logs.Error(e.Error())
return

View File

@ -98,7 +98,7 @@ func InsertDocToElaticSearch(doc Doc) error {
func CreateIndexFromMysqlTable(tblname string) error {
columns := []Field{}
e := db.GetMysqlClient().Query2("describe "+tblname, &columns)
e := db.GetMysqlClient().Query2("describe " + tblname, &columns)
if nil != e {
logger.Debug(e.Error())
return e
@ -163,7 +163,6 @@ func PortDocumentToElasticsearch(tblname string) error {
if nil != e {
log.Print(e.Error())
}
log.Print("index not existed , create " + tblname)
}
} else {
props := map[string]interface{}{}

View File

@ -80,15 +80,15 @@ func TestReflect(t *testing.T) {
}
// 测试新建索引,查看mapping是否生效
// test create new index,and check the mapping works
func TestCreateIndex(t *testing.T) {
InitConfig()
InitLogs()
InitRedisConfig()
InitMysql()
db.InitELK()
InitElasticSearch()
}
// // test create new index,and check the mapping works
// func TestCreateIndex(t *testing.T) {
// InitConfig()
// InitLogs()
// InitRedisConfig()
// InitMysql()
// db.InitELK()
// InitElasticSearch()
// }
// 测试query doc
// test doc query works