feat: implement cron worker for daily statistics updates and weekly S3 database backups
All checks were successful
Build and Release / release (push) Successful in 1m28s
All checks were successful
Build and Release / release (push) Successful in 1m28s
This commit is contained in:
@@ -19,7 +19,7 @@ import (
|
|||||||
|
|
||||||
func runStatistics(ctx context.Context, repo repositories.StatisticRepository) {
|
func runStatistics(ctx context.Context, repo repositories.StatisticRepository) {
|
||||||
log.Info().Msg("Running daily statistics...")
|
log.Info().Msg("Running daily statistics...")
|
||||||
today := time.Now().UTC().Truncate(24 * time.Hour)
|
today := time.Now().Truncate(24 * time.Hour)
|
||||||
_, err := repo.Upsert(ctx, today)
|
_, err := repo.Upsert(ctx, today)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("Failed to upsert system statistics")
|
log.Error().Err(err).Msg("Failed to upsert system statistics")
|
||||||
|
|||||||
Reference in New Issue
Block a user