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") id := c.Param("id")
log.Print("finish undo id",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", 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"),1)).Error time.Now().Format("2006-01-02 15:04:05"),id)).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)) 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 { if nil != e {
logs.Error(e.Error()) logs.Error(e.Error())
return return

View File

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

View File

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