Skip to content
This repository was archived by the owner on Jul 24, 2020. It is now read-only.

Commit 4a29ace

Browse files
ccaddenorenyk
authored andcommitted
Change scheduled rake tasks to execute now instead of later
Fixes #1739, #1740, #1741
1 parent b5d0a66 commit 4a29ace

6 files changed

+27
-14
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
* This file will be updated whenever a new release is put into production.
33
* Any problems should be reported via the "report an issue" link in the footer of the application.
44

5+
## v6.3.3 - 2018-07-20
6+
### Fixed
7+
* Modify daily/hourly Admin buttons to use relative path via helper method ([1742](https://github.com/YaleSTC/reservations/issues/1742))
8+
* Change rake daily/hourly tasks to execute immediately to fix issue with cron job in production ([#1739](https://github.com/YaleSTC/reservations/issues/1739), [#1740](https://github.com/YaleSTC/reservations/issues/1740), [#1741](https://github.com/YaleSTC/reservations/issues/1741))
9+
510
## v6.3.2 - 2018-06-26
611
### Fixed
712
* Fixed incorrect evaluation of reservations affected by a blackout ([#1644](https://github.com/YaleSTC/reservations/issues/1644)).

app/jobs/application_job.rb

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# frozen_string_literal: true
2+
3+
# Base class for Jobs
4+
class ApplicationJob < ActiveJob::Base; end

app/jobs/daily_tasks_job.rb

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
# frozen_string_literal: true
2-
class DailyTasksJob < ActiveJob::Base
2+
3+
class DailyTasksJob < ApplicationJob
34
queue_as :default
45

56
def perform
6-
FlagOverdueJob.perform_later
7-
FlagMissedJob.perform_later
8-
DenyMissedRequestsJob.perform_later
9-
EmailCheckinReminderJob.perform_later
10-
EmailCheckoutReminderJob.perform_later
11-
EmailMissedReservationsJob.perform_later
12-
EmailOverdueReminderJob.perform_later
13-
DeleteOldBlackoutsJob.perform_later
14-
DeleteMissedReservationsJob.perform_later
7+
FlagOverdueJob.perform_now
8+
FlagMissedJob.perform_now
9+
DenyMissedRequestsJob.perform_now
10+
EmailCheckinReminderJob.perform_now
11+
EmailCheckoutReminderJob.perform_now
12+
EmailMissedReservationsJob.perform_now
13+
EmailOverdueReminderJob.perform_now
14+
DeleteOldBlackoutsJob.perform_now
15+
DeleteMissedReservationsJob.perform_now
1516
end
1617
end

app/jobs/hourly_tasks_job.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# frozen_string_literal: true
2-
class HourlyTasksJob < ActiveJob::Base
2+
3+
class HourlyTasksJob < ApplicationJob
34
queue_as :default
45

56
def perform
6-
EmailNotesToAdminsJob.perform_later
7+
EmailNotesToAdminsJob.perform_now
78
end
89
end

spec/jobs/daily_tasks_job_spec.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# frozen_string_literal: true
2+
23
require 'spec_helper'
34

45
describe DailyTasksJob, type: :job do
56
shared_examples 'enqueues' do |job|
67
it "the #{job}" do
7-
expect(job).to receive(:perform_later)
8+
expect(job).to receive(:perform_now)
89
described_class.perform_now
910
end
1011
end

spec/jobs/hourly_tasks_job_spec.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# frozen_string_literal: true
2+
23
require 'spec_helper'
34

45
describe HourlyTasksJob, type: :job do
56
it 'enqueues the email notes to admins job' do
6-
expect(EmailNotesToAdminsJob).to receive(:perform_later)
7+
expect(EmailNotesToAdminsJob).to receive(:perform_now)
78
described_class.perform_now
89
end
910
end

0 commit comments

Comments
 (0)