docker 不支持 动态显示

master
Administrator 2024-05-02 13:16:38 +08:00
parent e960193151
commit e4e05b58f7
1 changed files with 4 additions and 4 deletions

View File

@ -17,13 +17,13 @@ var now = time.Now()
func main() { func main() {
fmt.Println("-----------------------------------------------------------------------------------------") fmt.Println("-----------------------------------------------------------------------------------------")
fmt.Println("-----------------------------------------------------------------------------------------") fmt.Println("-----------------------------------------------------------------------------------------")
log.Println(` log.Println(`
_____ _____
_/ ____\______ ____ _____ _____ ____ __ _ _______ ____ ____ _/ ____\______ ____ _____ _____ ____ __ _ _______ ____ ____
\ __\\_ __ \/ _ \ / \ \__ \ / _ \ \ \/ \/ /\__ \ / \ / ___\ \ __\\_ __ \/ _ \ / \ \__ \ / _ \ \ \/ \/ /\__ \ / \ / ___\
| | | | \( <_> ) Y Y \ / __ \( <_> ) \ / / __ \| | \/ /_/ > | | | | \( <_> ) Y Y \ / __ \( <_> ) \ / / __ \| | \/ /_/ >
|__| |__| \____/|__|_| / (____ /\____/ \/\_/ (____ /___| /\___ / |__| |__| \____/|__|_| / (____ /\____/ \/\_/ (____ /___| /\___ /
\/ \/ \/ \//_____/`) \/ \/ \/ \//_____/ `)
fmt.Println("-----------------------------------------------------------------------------------------") fmt.Println("-----------------------------------------------------------------------------------------")
fmt.Println("-----------------------------------------------------------------------------------------") fmt.Println("-----------------------------------------------------------------------------------------")
if maxRetries < 3 { if maxRetries < 3 {
@ -32,8 +32,8 @@ _/ ____\______ ____ _____ _____ ____ __ _ _______ ____ ____
if remainingTime <= 0 { if remainingTime <= 0 {
break // 当剩余时间小于等于0时跳出循环 break // 当剩余时间小于等于0时跳出循环
} }
fmt.Printf("\r距离执行定时任务还剩 %d小时 %d分钟 %d秒", int(remainingTime.Hours()), int(remainingTime.Minutes())%60, int(remainingTime.Seconds())%60) fmt.Printf("距离执行定时任务还剩 %d小时 %d分钟 %d秒\n", int(remainingTime.Hours()), int(remainingTime.Minutes())%60, int(remainingTime.Seconds())%60)
time.Sleep(time.Second) // 等待一秒钟,然后更新 time.Sleep(time.Minute * 10) // 等待30分钟钟,然后更新
} }
// 定义任务,每周五的五点执行 // 定义任务,每周五的五点执行
gocron.Every(1).Friday().At("17:00").Do(job) gocron.Every(1).Friday().At("17:00").Do(job)