本文整理匯總了Golang中github.com/BestianRU/SABModules/SBMSystem.LogFile.Bye方法的典型用法代碼示例。如果您正苦於以下問題:Golang LogFile.Bye方法的具體用法?Golang LogFile.Bye怎麽用?Golang LogFile.Bye使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/BestianRU/SABModules/SBMSystem.LogFile
的用法示例。
在下文中一共展示了LogFile.Bye方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: goNTUWork
//.........這裏部分代碼省略.........
if err != nil {
log.Printf("MySQL::Query() error: %v\n", err)
log.Printf("%s\n", queryx)
return
}
queryx = ""
multiCount = 0
}
//idxUsers++
}
rLog.Log("\t\tComplete!")
if workMode == "PART" {
rLog.Log("\tUpdate tables in PartialUpdate mode...")
for j := 0; j < len(usIDArray); j++ {
log.Printf("\t\t\tUpdate %d/%s...\n", usIDArray[j].id, usIDArray[j].name)
for i := 0; i < len(mySQL_Update_part1); i++ {
log.Printf("\t\t\tstep %d (%d of %d)...\n", j+1, i+1, len(mySQL_Update_part1))
if my.QSimple(strings.Replace(mySQL_Update_part1[i], "XYZIDXYZ", fmt.Sprintf("%d", usIDArray[j].id), -1)) < 0 {
log.Println("MySQL: Update error")
return
}
time.Sleep(2 * time.Second)
}
for i := 0; i < len(mySQL_Update1); i++ {
log.Printf("\t\t\tstep %d (%d of %d)...\n", j+1, i+1, len(mySQL_Update1))
if my.QSimple(mySQL_Update1[i]) < 0 {
log.Println("MySQL: Update error")
return
}
time.Sleep(2 * time.Second)
}
for i := 0; i < len(mySQL_Update_part2); i++ {
log.Printf("\t\t\tstep %d (%d of %d)...\n", j+1, i+1, len(mySQL_Update_part2))
if my.QSimple(strings.Replace(mySQL_Update_part2[i], "XYZIDXYZ", fmt.Sprintf("%d", usIDArray[j].id), -1)) < 0 {
log.Println("MySQL: Update error")
return
}
time.Sleep(2 * time.Second)
}
for i := 0; i < len(mySQL_Update2); i++ {
log.Printf("\t\t\tstep %d (%d of %d)...\n", j+1, i+1, len(mySQL_Update2))
if my.QSimple(mySQL_Update2[i]) < 0 {
log.Println("MySQL: Update error")
return
}
time.Sleep(2 * time.Second)
}
time.Sleep(2 * time.Second)
}
} else {
rLog.Log("\tUpdate tables...")
for i := 0; i < len(mySQL_Update_full1); i++ {
log.Printf("\t\t\tstep %d of %d...\n", i+1, len(mySQL_Update_full1))
if my.QSimple(mySQL_Update_full1[i]) < 0 {
log.Println("MySQL: Update error")
return
}
time.Sleep(2 * time.Second)
}
for i := 0; i < len(mySQL_Update1); i++ {
log.Printf("\t\t\tstep %d of %d...\n", i+1, len(mySQL_Update1))
if my.QSimple(mySQL_Update1[i]) < 0 {
log.Println("MySQL: Update error")
return
}
time.Sleep(2 * time.Second)
}
for i := 0; i < len(mySQL_Update_full2); i++ {
log.Printf("\t\t\tstep %d of %d...\n", i+1, len(mySQL_Update_full2))
if my.QSimple(mySQL_Update_full2[i]) < 0 {
log.Println("MySQL: Update error")
return
}
time.Sleep(2 * time.Second)
}
for i := 0; i < len(mySQL_Update2); i++ {
log.Printf("\t\t\tstep %d of %d...\n", i+1, len(mySQL_Update2))
if my.QSimple(mySQL_Update2[i]) < 0 {
log.Println("MySQL: Update error")
return
}
time.Sleep(2 * time.Second)
}
}
rLog.Log("\t\tComplete!")
rLog.Log("\tClean NeedToUpdate table...")
if pg.QSimple("delete from aaa_dav_ntu where userid=0 or updtime<", time_now, ";") < 0 {
log.Println("PgSQL: Clean NTU table error")
return
}
rLog.Log("\tComplete!")
rLog.Bye()
}