cron icon indicating copy to clipboard operation
cron copied to clipboard

[bug report] Change machine time , while app is running, will make cron task fall into fatally endless loop.

Open fwhezfwhez opened this issue 4 years ago • 0 comments

c.AddFunc("0 * * * * ?", QueryBalanceOver100)

Function QueryBalanceOver100 is expected to run once per minute. When app is running, and then, I change local time to tomorrow, this task will execute unexpected times in a short time.

Here is log, this repeated job drown my db connections:

[2020-10-17 14:07:59]  [2236.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it. 
2020-10-17 14:07:59 | G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:24 | dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it.

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2236.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it. 
2020-10-17 14:07:59 | G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:24 | dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it.

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2236.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it. 
2020-10-17 14:07:59 | G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:24 | dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it.

{
    "srv": "xyx_srv"
  }

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2238.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it. 
2020-10-17 14:07:59 | G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:24 | dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it.

{
    "srv": "xyx_srv"
  }

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2242.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it. 
2020-10-17 14:07:59 | G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:24 | dial tcp [::1]:5432: connectex: No connection could be made because the target machine actively refused it.

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2395.00ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2238.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2239.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2243.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2243.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  
[0 rows affected or returned ] 

(G:/go_workspace/GOPATH/src/shangraomajiang/control/item/match100/match100Job/match100_user_balance.go:23) 
[2020-10-17 14:07:59]  [2243.99ms]  SELECT count(*) FROM "user_invisible_prop"  WHERE (prop_id=95 and amount>=10000)  

fwhezfwhez avatar Oct 14 '20 06:10 fwhezfwhez