Skip to content

Commit 5ba6fb4

Browse files
committed
Add check for empty data
1 parent 8ce4d48 commit 5ba6fb4

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

.claude/settings.local.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"Bash(git commit:*)",
66
"Bash(git push:*)",
77
"Bash(curl:*)",
8-
"Bash(mkdir:*)"
8+
"Bash(mkdir:*)",
9+
"Bash(grep:*)"
910
],
1011
"deny": []
1112
}

app/models/statcan_dataset.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ def needs_sync?(current_time = Time.current)
1919

2020
def sync!
2121
data = StatcanFetcher.fetch(statcan_url)
22+
23+
raise "StatcanDataset sync failed: No data received from StatCan API" if data.blank?
24+
2225
update!(current_data: data, last_synced_at: Time.current)
2326
end
2427

config/environments/production.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@
6565
password: Rails.application.credentials.dig(:smtp, :password),
6666
address: Rails.application.credentials.dig(:smtp, :address),
6767
port: 587,
68-
authentication: :plain
68+
authentication: :plain,
69+
enable_starttls_auto: true,
70+
open_timeout: 5,
71+
read_timeout: 5
6972
}
7073

7174
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to

0 commit comments

Comments
 (0)