Fix crons to actually run correctly using the configuration values

This commit is contained in:
DaneEveritt
2022-07-24 15:59:17 -04:00
parent 4634c93182
commit 251f91a08e
4 changed files with 17 additions and 10 deletions

View File

@@ -14,7 +14,7 @@ import (
type sftpCron struct {
mu *system.AtomicBool
manager *server.Manager
max int64
max int
}
type mapKey struct {
@@ -52,7 +52,7 @@ func (sc *sftpCron) Run(ctx context.Context) error {
events := &eventMap{
m: map[mapKey]*models.Activity{},
ids: []int{},
max: int(sc.max),
max: sc.max,
}
for {
@@ -102,7 +102,7 @@ func (sc *sftpCron) fetchRecords(ctx context.Context, offset int) (activity []mo
Where("event LIKE ?", "server:sftp.%").
Order("event DESC").
Offset(offset).
Limit(int(sc.max)).
Limit(sc.max).
Find(&activity)
if tx.Error != nil {
err = errors.WithStack(tx.Error)