diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-07 14:19:27 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-07 14:46:17 +0000 |
| commit | 3dfec1e449f260295e8c5c505dd1edb82d787c58 (patch) | |
| tree | f093ebfd02cbc16ca2c3c36f98601a78cf0876fd /src/nostr | |
| parent | 74979c1de32f69a39e0e290f56435ef687c2b6f6 (diff) | |
Wire up new purgatory sync loop, remove legacy sync_state_git_data
Phase 13 of purgatory-sync-redesign:
- Add sync loop startup in main.rs (RealSyncContext + ThrottleManager + start_sync_loop)
- Update add_state() and add_pr() to automatically enqueue for background sync
- Remove start_state_sync() call from state.rs (now handled by sync loop)
- Remove orphaned legacy functions: sync_state_git_data, fetch_missing_oids_from_server,
get_most_complete_local_repo, identify_missing_oids, get_date_of_most_recent_commit_on_default_branch
- Clean up unused imports in purgatory/mod.rs
Diffstat (limited to 'src/nostr')
| -rw-r--r-- | src/nostr/policy/state.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/nostr/policy/state.rs b/src/nostr/policy/state.rs index a85e351..7d69d7d 100644 --- a/src/nostr/policy/state.rs +++ b/src/nostr/policy/state.rs | |||
| @@ -152,18 +152,11 @@ impl StatePolicy { | |||
| 152 | Ok(WritePolicyResult::Accept) // event should be saved and broadcast | 152 | Ok(WritePolicyResult::Accept) // event should be saved and broadcast |
| 153 | } else { | 153 | } else { |
| 154 | // if no git data - add to purgatory | 154 | // if no git data - add to purgatory |
| 155 | // (add_state automatically enqueues for background sync) | ||
| 155 | self.ctx | 156 | self.ctx |
| 156 | .purgatory | 157 | .purgatory |
| 157 | .add_state(event.clone(), state.identifier.clone(), event.pubkey); | 158 | .add_state(event.clone(), state.identifier.clone(), event.pubkey); |
| 158 | 159 | ||
| 159 | // Trigger background git data sync from remote servers | ||
| 160 | self.ctx.purgatory.start_state_sync( | ||
| 161 | state.clone(), | ||
| 162 | self.ctx.database.clone(), | ||
| 163 | Some(self.ctx.domain.clone()), | ||
| 164 | self.ctx.get_local_relay(), | ||
| 165 | ); | ||
| 166 | |||
| 167 | tracing::info!( | 160 | tracing::info!( |
| 168 | "state event added to purgatory: eventid: {}, identifier: {}", | 161 | "state event added to purgatory: eventid: {}, identifier: {}", |
| 169 | state.event.id, | 162 | state.event.id, |