update block date (infiny loop)
This commit is contained in:
parent
84fd3269cc
commit
b3d57a5f94
|
@ -21,11 +21,11 @@ func runCalendar(wg *sync.WaitGroup) {
|
||||||
func main() {
|
func main() {
|
||||||
argFormat := flag.String("format", "%H:%M:%S %m-%d-%Y", "time format")
|
argFormat := flag.String("format", "%H:%M:%S %m-%d-%Y", "time format")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
now := time.Now()
|
|
||||||
|
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
|
|
||||||
|
for {
|
||||||
|
now := time.Now()
|
||||||
|
|
||||||
if os.Getenv("BLOCK_BUTTON") == "1" {
|
if os.Getenv("BLOCK_BUTTON") == "1" {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go runCalendar(&wg)
|
go runCalendar(&wg)
|
||||||
|
@ -42,5 +42,8 @@ func main() {
|
||||||
|
|
||||||
block := r.Block("date", options)
|
block := r.Block("date", options)
|
||||||
fmt.Println(block)
|
fmt.Println(block)
|
||||||
|
time.Sleep(time.Millisecond * 500)
|
||||||
|
}
|
||||||
|
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue