Improve for/range loop to avoid linter error
This commit is contained in:
parent
0c7039de0e
commit
cbd273da2b
1 changed files with 2 additions and 2 deletions
|
@ -15,7 +15,7 @@ import (
|
||||||
func NewFeedScheduler(store *storage.Storage, workerPool *WorkerPool, frequency, batchSize int) {
|
func NewFeedScheduler(store *storage.Storage, workerPool *WorkerPool, frequency, batchSize int) {
|
||||||
go func() {
|
go func() {
|
||||||
c := time.Tick(time.Duration(frequency) * time.Minute)
|
c := time.Tick(time.Duration(frequency) * time.Minute)
|
||||||
for _ = range c {
|
for range c {
|
||||||
jobs, err := store.NewBatch(batchSize)
|
jobs, err := store.NewBatch(batchSize)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("[FeedScheduler] %v", err)
|
logger.Error("[FeedScheduler] %v", err)
|
||||||
|
@ -31,7 +31,7 @@ func NewFeedScheduler(store *storage.Storage, workerPool *WorkerPool, frequency,
|
||||||
func NewSessionScheduler(store *storage.Storage, frequency int) {
|
func NewSessionScheduler(store *storage.Storage, frequency int) {
|
||||||
go func() {
|
go func() {
|
||||||
c := time.Tick(time.Duration(frequency) * time.Hour)
|
c := time.Tick(time.Duration(frequency) * time.Hour)
|
||||||
for _ = range c {
|
for range c {
|
||||||
nbSessions := store.CleanOldSessions()
|
nbSessions := store.CleanOldSessions()
|
||||||
nbUserSessions := store.CleanOldUserSessions()
|
nbUserSessions := store.CleanOldUserSessions()
|
||||||
logger.Info("[SessionScheduler] cleaned %d sessions and %d user sessions", nbSessions, nbUserSessions)
|
logger.Info("[SessionScheduler] cleaned %d sessions and %d user sessions", nbSessions, nbUserSessions)
|
||||||
|
|
Loading…
Reference in a new issue