Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Modularization of Task Scheduling #194

Merged
merged 2 commits into from
Nov 30, 2024

Conversation

GODrums
Copy link
Collaborator

@GODrums GODrums commented Nov 29, 2024

Motivation

For future features (such as the leaderboard leagues) we need to be able to execute tasks easily at the end of each leaderboard cycle.
Implements task 3.1 of #170.

Description

This PR reworks the original task scheduler used for the weekly Slack message to be more modular (separating the logic) and easily support adding new tasks:

  • LeaderboardTaskScheduler now manages all tasks and schedules them for the end of a leaderboard cycle
  • SlackMessageService is now only a light wrapper around the SlackAppConfig, providing implementations for sending messages and testing the connection
  • SlackWeeklyLeaderboardTask is a runnable task, scheduled by the LeaderboardTaskScheduler, responsible for creating the Slack message and delegating the sending process

Testing Instructions

No manual testing required - Code reviews would be great though!
Would love to receive feedback on:

  • folder structure
  • potential for structural simplifications
  • does the code need more comments?

Checklist

General

  • PR title is clear and descriptive
  • PR description explains the purpose and changes
  • Code follows project coding standards
  • Self-review of the code has been done
  • Changes have been tested locally
  • Screenshots have been attached (if applicable)
  • Documentation has been updated (if applicable)

Server (if applicable)

  • Code is performant and follows best practices
  • No security vulnerabilities introduced
  • Proper error handling has been implemented
  • Added tests for new functionality
  • Changes have been tested in different environments (if applicable)

@GODrums GODrums self-assigned this Nov 29, 2024
@github-actions github-actions bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Nov 29, 2024
@GODrums GODrums mentioned this pull request Nov 29, 2024
15 tasks
Copy link
Collaborator

@FelixTJDietrich FelixTJDietrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code also looks good to me, folder structure and documentation seems also fine to me 🤔

@FelixTJDietrich FelixTJDietrich merged commit 6f8ff92 into develop Nov 30, 2024
7 of 8 checks passed
@FelixTJDietrich FelixTJDietrich deleted the 170-modular-task-scheduler branch November 30, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
application-server size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants