Skip to content

Commit

Permalink
fix: cron jobs (#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruilopesm authored Feb 8, 2024
1 parent 9f1a1f4 commit 5639bbb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
16 changes: 8 additions & 8 deletions lib/safira/job_scheduler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -79,42 +79,42 @@ defmodule Safira.JobScheduler do
),
create_job(
:visit_five_booths,
~e[20 * * * *],
~e[13 * * * *],
{Jobs.CheckpointBadge, :run, [235, 5, 4, 10]}
),
create_job(
:visit_ten_booths,
~e[21 * * * *],
~e[14 * * * *],
{Jobs.CheckpointBadge, :run, [236, 10, 4, 30]}
),
create_job(
:visit_fifteen_booths,
~e[22 * * * *],
~e[15 * * * *],
{Jobs.CheckpointBadge, :run, [237, 15, 4, 60]}
),
create_job(
:visit_twenty_booths,
~e[23 * * * *],
~e[16 * * * *],
{Jobs.CheckpointBadge, :run, [238, 20, 4, 100]}
),
create_job(
:visit_twenty_five_booths,
~e[24 * * * *],
~e[17 * * * *],
{Jobs.CheckpointBadge, :run, [239, 25, 4, 120]}
),
create_job(
:visit_all_booths,
~e[25 * * * *],
~e[18 * * * *],
{Jobs.CheckpointBadge, :run, [240, 28, 4, 150]}
),
create_job(
:upload_cv,
~e[26 * * * *],
~e[19 * * * *],
{Jobs.CVBadge, :run, [294]}
),
create_job(
:spotlight,
~e[27 * * * *],
~e[20 * * * *],
{Jobs.SpotlightBadge, :run, [242]}
)
]
Expand Down
2 changes: 1 addition & 1 deletion lib/safira/jobs/all_gold_badge.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defmodule Safira.Jobs.AllGoldBadge do
@spec run(integer()) :: :ok
def run(badge_id) do
list_eligible_attendees()
|> Enum.each(&create_redeem(&1.id, badge_id))
|> Enum.each(&create_redeem(&1, badge_id))
end

defp list_eligible_attendees do
Expand Down
1 change: 1 addition & 0 deletions lib/safira/jobs/checkpoint_badge.ex
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,6 @@ defmodule Safira.Jobs.CheckpointBadge do
}
)
)
|> Repo.transaction()
end
end

0 comments on commit 5639bbb

Please sign in to comment.