feat: Update S3 migration schedule to hourly and limit old account retrieval to 3000 records

This commit is contained in:
Frederico Santos 2024-10-17 00:46:27 +01:00
parent 72426e5932
commit 51b5332d21
2 changed files with 2 additions and 3 deletions

View File

@ -96,8 +96,7 @@ func Init() error {
return nil
}
S3SaveMigration()
_, err = s3scheduler.AddFunc("@weekly", func() {
_, err = s3scheduler.AddFunc("@hourly", func() {
time.Sleep(time.Second)
S3SaveMigration()
})

View File

@ -270,7 +270,7 @@ func RetrieveSystemSaveFromS3(uuid []byte) error {
func RetrieveOldAccounts() [][]byte {
var users [][]byte
rows, err := handle.Query("SELECT uuid FROM accounts WHERE isInLocalDb = 1 && lastActivity < DATE_SUB(NOW(), INTERVAL 3 MONTH)")
rows, err := handle.Query("SELECT uuid FROM accounts WHERE isInLocalDb = 1 && lastActivity < DATE_SUB(NOW(), INTERVAL 3 MONTH) LIMIT 3000")
if err != nil {
return nil
}