Skip to content

Commit

Permalink
Fix week refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
tesence committed Nov 4, 2024
1 parent 7e419b0 commit dac9ade
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gumo/modules/league.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,16 @@ async def cog_app_command_error(self, interaction: discord.Interaction,
return await interaction.response.send_message("You don't have the permissions to use this command",
ephemeral=True)

@tasks.loop(time=time(hour=20, minute=59, second=30, tzinfo=EASTERN_TZ))
@tasks.loop(time=time(hour=21, minute=0, second=5, tzinfo=EASTERN_TZ))
async def _week_refresh(self):
"""Weekly task that auto DNF runners that haven't submitted in time"""

if not datetime.now(EASTERN_TZ).weekday() == 4:
date = datetime.now(EASTERN_TZ)

if not date.weekday() == 4:
return

week_start_date = get_current_week_start_date()
week_start_date = get_week_start_date(date - timedelta(hours=1))
submissions = await self._get_submissions(week_start_date)

# DNF runners only if there is at least one submission. If there is no submission, it means the season is over.
Expand Down

0 comments on commit dac9ade

Please sign in to comment.