Skip to content

Commit 0d8b147

Browse files
committed
Update scheduled task for fund synchronization and refine sync logic to target featured funds
1 parent 3413ea4 commit 0d8b147

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
{
1212
"command": "bundle exec rake funds:sync_least_recent",
13-
"schedule": "*/30 * * * *"
13+
"schedule": "0 * * * *"
1414
},
1515
{
1616
"command": "bundle exec rake funding_sources:update_project_allocation_funding_sources",

app/models/fund.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Fund < ApplicationRecord
1515

1616

1717
def self.sync_least_recently_synced
18-
Fund.where(last_synced_at: nil).or(Fund.where("last_synced_at < ?", 1.day.ago)).order('last_synced_at asc nulls first').limit(10).each do |fund|
18+
Fund.featured.where(last_synced_at: nil).or(Fund.where("last_synced_at < ?", 1.day.ago)).order('last_synced_at asc nulls first').limit(10).each do |fund|
1919
fund.sync_async
2020
end
2121
end

0 commit comments

Comments
 (0)