diff options
Diffstat (limited to 'src/git/sync.rs')
| -rw-r--r-- | src/git/sync.rs | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/git/sync.rs b/src/git/sync.rs index b3fa11a..4b35023 100644 --- a/src/git/sync.rs +++ b/src/git/sync.rs | |||
| @@ -44,7 +44,6 @@ use crate::git::{self, oid_exists}; | |||
| 44 | use crate::nostr::builder::SharedDatabase; | 44 | use crate::nostr::builder::SharedDatabase; |
| 45 | use crate::nostr::events::RepositoryState; | 45 | use crate::nostr::events::RepositoryState; |
| 46 | use crate::purgatory::{can_apply_state, Purgatory}; | 46 | use crate::purgatory::{can_apply_state, Purgatory}; |
| 47 | use crate::sync::{RepoSyncIndex, SyncLevel}; | ||
| 48 | 47 | ||
| 49 | /// Result of processing newly available git data. | 48 | /// Result of processing newly available git data. |
| 50 | /// | 49 | /// |
| @@ -810,7 +809,6 @@ pub fn extract_identifier_from_pr_event(event: &Event) -> Option<String> { | |||
| 810 | /// * `local_relay` - Local relay for notifying WebSocket subscribers (optional) | 809 | /// * `local_relay` - Local relay for notifying WebSocket subscribers (optional) |
| 811 | /// * `purgatory` - Purgatory instance to check for satisfiable events | 810 | /// * `purgatory` - Purgatory instance to check for satisfiable events |
| 812 | /// * `git_data_path` - Base path for git repositories | 811 | /// * `git_data_path` - Base path for git repositories |
| 813 | /// * `repo_sync_index` - Optional repo sync index for upgrading sync level on promotion | ||
| 814 | /// | 812 | /// |
| 815 | /// # Returns | 813 | /// # Returns |
| 816 | /// A `ProcessResult` describing what was processed | 814 | /// A `ProcessResult` describing what was processed |
| @@ -821,7 +819,6 @@ pub async fn process_newly_available_git_data( | |||
| 821 | local_relay: Option<&nostr_relay_builder::LocalRelay>, | 819 | local_relay: Option<&nostr_relay_builder::LocalRelay>, |
| 822 | purgatory: &Purgatory, | 820 | purgatory: &Purgatory, |
| 823 | git_data_path: &Path, | 821 | git_data_path: &Path, |
| 824 | repo_sync_index: Option<RepoSyncIndex>, | ||
| 825 | ) -> anyhow::Result<ProcessResult> { | 822 | ) -> anyhow::Result<ProcessResult> { |
| 826 | let mut result = ProcessResult::default(); | 823 | let mut result = ProcessResult::default(); |
| 827 | 824 | ||
| @@ -851,7 +848,6 @@ pub async fn process_newly_available_git_data( | |||
| 851 | local_relay, | 848 | local_relay, |
| 852 | purgatory, | 849 | purgatory, |
| 853 | git_data_path, | 850 | git_data_path, |
| 854 | repo_sync_index.as_ref(), | ||
| 855 | ) | 851 | ) |
| 856 | .await; | 852 | .await; |
| 857 | result.merge(announcement_result); | 853 | result.merge(announcement_result); |
| @@ -1288,7 +1284,6 @@ async fn process_purgatory_announcements( | |||
| 1288 | local_relay: Option<&nostr_relay_builder::LocalRelay>, | 1284 | local_relay: Option<&nostr_relay_builder::LocalRelay>, |
| 1289 | purgatory: &Purgatory, | 1285 | purgatory: &Purgatory, |
| 1290 | git_data_path: &Path, | 1286 | git_data_path: &Path, |
| 1291 | repo_sync_index: Option<&RepoSyncIndex>, | ||
| 1292 | ) -> ProcessResult { | 1287 | ) -> ProcessResult { |
| 1293 | let mut result = ProcessResult::default(); | 1288 | let mut result = ProcessResult::default(); |
| 1294 | 1289 | ||
| @@ -1343,22 +1338,6 @@ async fn process_purgatory_announcements( | |||
| 1343 | } | 1338 | } |
| 1344 | } | 1339 | } |
| 1345 | 1340 | ||
| 1346 | // Upgrade sync level to Full in repo_sync_index | ||
| 1347 | if let Some(index) = repo_sync_index { | ||
| 1348 | let mut index = index.write().await; | ||
| 1349 | // Use hex pubkey format to match how repo_sync_index keys are built | ||
| 1350 | // (sync/mod.rs uses event.pubkey which is hex, not bech32) | ||
| 1351 | let repo_id = format!("30617:{}:{}", owner.to_hex(), identifier); | ||
| 1352 | if let Some(entry) = index.get_mut(&repo_id) { | ||
| 1353 | entry.sync_level = SyncLevel::Full; | ||
| 1354 | debug!( | ||
| 1355 | identifier = %identifier, | ||
| 1356 | repo_id = %repo_id, | ||
| 1357 | "Upgraded sync level to Full after announcement promotion" | ||
| 1358 | ); | ||
| 1359 | } | ||
| 1360 | } | ||
| 1361 | |||
| 1362 | result.announcements_released += 1; | 1341 | result.announcements_released += 1; |
| 1363 | } | 1342 | } |
| 1364 | Err(e) => { | 1343 | Err(e) => { |