mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-22 22:59:39 +02:00
Handle stale syncs (#2257)
* Handle stale syncs * Use `visible` sync logic in sidebar groups
This commit is contained in:
parent
10f255a9a9
commit
9f13b5bb83
9 changed files with 79 additions and 7 deletions
|
@ -167,4 +167,25 @@ class SyncTest < ActiveSupport::TestCase
|
|||
assert_equal "failed", family_sync.reload.status
|
||||
assert_equal "completed", account_sync.reload.status
|
||||
end
|
||||
|
||||
test "clean marks stale incomplete rows" do
|
||||
stale_pending = Sync.create!(
|
||||
syncable: accounts(:depository),
|
||||
status: :pending,
|
||||
created_at: 3.hours.ago
|
||||
)
|
||||
|
||||
stale_syncing = Sync.create!(
|
||||
syncable: accounts(:depository),
|
||||
status: :syncing,
|
||||
created_at: 3.hours.ago,
|
||||
pending_at: 3.hours.ago,
|
||||
syncing_at: 2.hours.ago
|
||||
)
|
||||
|
||||
Sync.clean
|
||||
|
||||
assert_equal "stale", stale_pending.reload.status
|
||||
assert_equal "stale", stale_syncing.reload.status
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue