Skip to content

Commit

Permalink
Update india matview and cache refresh time (#5294)
Browse files Browse the repository at this point in the history
**Story card:**
[sc-11220](https://app.shortcut.com/simpledotorg/story/11220)

## Because

Due to the infra scale-down, the mat view refresh is taking 26 hours.
Therefore, we've moved the refresh start time to Saturday evening at 5
PM and adjusted the cache warming to 11:44 PM

## This addresses

Reporting data issues in the dashboard and progress tab
  • Loading branch information
roypeter authored Oct 6, 2023
1 parent 61ed11d commit 0c959aa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions config/schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ def local(time)
"07:00 pm"
].map { |t| local(t) }

REPORTS_REFRESH_FREQUENCY = CountryConfig.current_country?("India") ? :sunday : :day
REPORTS_CACHE_REFRESH_TIME = CountryConfig.current_country?("India") ? "12:00 pm" : "04:30 am"
REPORTS_REFRESH_FREQUENCY = CountryConfig.current_country?("India") ? :saturday : :day
REPORTS_REFRESH_TIME = CountryConfig.current_country?("India") ? "05:00 pm" : "12:30 am"
REPORTS_CACHE_REFRESH_TIME = CountryConfig.current_country?("India") ? "11:55 pm" : "04:30 am"

every :day, at: FOLLOW_UP_TIMES, roles: [:cron] do
rake "db:refresh_daily_follow_ups_and_registrations"
Expand Down Expand Up @@ -73,7 +74,7 @@ def local(time)
rake "exotel_tasks:whitelist_patient_phone_numbers"
end

every REPORTS_REFRESH_FREQUENCY, at: local("12:30 am"), roles: [:cron] do
every REPORTS_REFRESH_FREQUENCY, at: local(REPORTS_REFRESH_TIME), roles: [:cron] do
rake "db:refresh_reporting_views"
end

Expand Down

0 comments on commit 0c959aa

Please sign in to comment.