Skip to content

Commit e43b42c

Browse files
authored
feat: update plan refresh cron job (#359)
* feat: update cron job * fix: remove env * fix: update config
1 parent 10b33f5 commit e43b42c

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

config/manual.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ JWT_RSA_PUBLIC_KEY_LOC=sample/rsa-public
44
HTTPS_CERT=sample/server.crt
55
USERNAME=foo
66
PASSWORD=bar
7-
87
HTTPS_KEY=sample/server.key
98
JWT_ROLE_KEY=role
109
SET_SNIFFING=false

main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,17 +301,17 @@ func main() {
301301

302302
mainRouter := router.PathPrefix("").Subrouter()
303303

304-
if PlanRefreshInterval == "" {
305-
PlanRefreshInterval = "1"
306-
} else {
304+
// default is hourly
305+
interval := "0 0 * * * *"
306+
307+
if PlanRefreshInterval != "" {
307308
_, err := strconv.Atoi(PlanRefreshInterval)
308309
if err != nil {
309310
log.Fatal("PLAN_REFRESH_INTERVAL must be an integer: ", err)
310311
}
312+
interval = "0 0 0-59/" + PlanRefreshInterval + " * * *"
311313
}
312314

313-
interval := "@every " + PlanRefreshInterval + "h"
314-
315315
util.Billing = Billing
316316
util.HostedBilling = HostedBilling
317317
util.ClusterBilling = ClusterBilling

0 commit comments

Comments
 (0)