Skip to content

Commit

Permalink
Remove competitions after 90 days (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatanklosko authored Dec 10, 2024
1 parent 5a47b0e commit b476dde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/wca_live/competitions.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule WcaLive.Competitions do
alias WcaLive.Repo
alias WcaLive.Competitions.{Competition, Person}

@competition_deletable_after_days 180
@competition_deletable_after_days 90

@doc """
Returns a list of competitions.
Expand Down
6 changes: 3 additions & 3 deletions test/wca_live/competitions_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ defmodule WcaLive.CompetitionsTest do
today = Date.utc_today()

competition_before =
insert(:competition, start_date: Date.add(today, -191), end_date: Date.add(today, -190))
insert(:competition, start_date: Date.add(today, -101), end_date: Date.add(today, -100))

competition_at =
insert(:competition, start_date: Date.add(today, -181), end_date: Date.add(today, -180))
insert(:competition, start_date: Date.add(today, -91), end_date: Date.add(today, -90))

competition_after =
insert(:competition, start_date: Date.add(today, -171), end_date: Date.add(today, -170))
insert(:competition, start_date: Date.add(today, -81), end_date: Date.add(today, -80))

competition_future =
insert(:competition, start_date: Date.add(today, 1), end_date: Date.add(today, 1))
Expand Down

0 comments on commit b476dde

Please sign in to comment.