Skip to content

Commit

Permalink
Added level points job
Browse files Browse the repository at this point in the history
  • Loading branch information
Thundernerd committed Nov 4, 2024
1 parent 9cb80ab commit 097c49b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
3 changes: 2 additions & 1 deletion Jobs/JobScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public void Enqueue<TJob>(params object[] args)
public void ScheduleRecurringJobs()
{
#if DEBUG
ScheduleRecurringJob<DownloadAllLevelsJob>(Cron.Never());
ScheduleRecurringJob<FixWorldRecordsJob>(Cron.Never());
ScheduleRecurringJob<FixPersonalBestsJob>(Cron.Never());
ScheduleRecurringJob<ProcessLevelRequestsJob>(Cron.Never());
Expand All @@ -61,7 +62,7 @@ public void ScheduleRecurringJobs()
}
else
{
ScheduleRecurringJob<CalculateLevelPointsJob>(Cron.Never());
ScheduleRecurringJob<CalculateLevelPointsJob>(Cron.Daily());
ScheduleRecurringJob<CalculateUserPointsJob>(Cron.Hourly());
}
#endif
Expand Down
13 changes: 0 additions & 13 deletions Levels/Points/Jobs/CalculateLevelPointsJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,6 @@ public Task ExecuteAsync()
if (existingLevelPoints.Count > 0)
_levelPointsService.UpdateRange(existingLevelPoints.Values);

// foreach (int levelId in levelIds)
// {
// int levelPoints = allPersonalBests.Count(x => x.IdLevel == levelId);
// if (levelPoints < 8)
// levelPoints = 0;
//
// if (levelItems.All(x => x.IdLevel != levelId))
// levelPoints = 0;
//
// _levelPointsService.Update(levelId, levelPoints);
// _logger.LogInformation("Updated level {LevelId} with {LevelPoints} points", levelId, levelPoints);
// }

_logger.LogInformation("Finished calculating level points");
return Task.CompletedTask;
}
Expand Down

0 comments on commit 097c49b

Please sign in to comment.