Commit 447c6dc
Reload TrackerList when hosts are automatically updated (#502)
* Initial plan
* Add TrackerList reload when hosts are updated
- Add reloadTrackerData() method to TrackerList to clear and reload tracker data
- Change trackingIps from HashSet to ConcurrentHashMap.newKeySet() for thread safety
- Call reloadTrackerData() from prepareHostsBlocked() after hosts are reloaded
- Invalidate tracker count cache when tracker data is reloaded
- Ensures TrackerList stays in sync with updated hosts from automatic downloads
Co-authored-by: kasnder <5175206+kasnder@users.noreply.github.com>
* Address code review feedback
- Use getInstance(c) in reloadTrackerData() to ensure instance is created
- Fix ActivitySettings to use reloadTrackerData() instead of loadTrackers()
to properly clear old data when domain_based_blocked setting changes
Co-authored-by: kasnder <5175206+kasnder@users.noreply.github.com>
* Add synchronization to reloadTrackerData()
- Add reloadLock to synchronize tracker data reload operations
- Wrap entire reload operation in synchronized block to prevent race conditions
- Ensures atomic clear and reload of tracker data
Co-authored-by: kasnder <5175206+kasnder@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kasnder <5175206+kasnder@users.noreply.github.com>1 parent 7930ad8 commit 447c6dc
3 files changed
Lines changed: 32 additions & 3 deletions
File tree
- app/src/main/java
- eu/faircode/netguard
- net/kollnig/missioncontrol/data
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
715 | 715 | | |
716 | 716 | | |
717 | 717 | | |
718 | | - | |
719 | | - | |
| 718 | + | |
720 | 719 | | |
721 | 720 | | |
722 | 721 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1799 | 1799 | | |
1800 | 1800 | | |
1801 | 1801 | | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
1802 | 1805 | | |
1803 | 1806 | | |
1804 | 1807 | | |
| |||
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
130 | 133 | | |
131 | 134 | | |
132 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
133 | 160 | | |
134 | 161 | | |
135 | 162 | | |
| |||
0 commit comments