diff options
Diffstat (limited to 'src/git/sync.rs')
| -rw-r--r-- | src/git/sync.rs | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/src/git/sync.rs b/src/git/sync.rs index 5e2d3f2..06013a5 100644 --- a/src/git/sync.rs +++ b/src/git/sync.rs | |||
| @@ -837,13 +837,27 @@ pub async fn process_newly_available_git_data( | |||
| 837 | ); | 837 | ); |
| 838 | 838 | ||
| 839 | // Process state events from purgatory | 839 | // Process state events from purgatory |
| 840 | let state_result = | 840 | let state_result = process_purgatory_state_events( |
| 841 | process_purgatory_state_events(&identifier, source_repo_path, database, local_relay, purgatory, git_data_path).await; | 841 | &identifier, |
| 842 | source_repo_path, | ||
| 843 | database, | ||
| 844 | local_relay, | ||
| 845 | purgatory, | ||
| 846 | git_data_path, | ||
| 847 | ) | ||
| 848 | .await; | ||
| 842 | result.merge(state_result); | 849 | result.merge(state_result); |
| 843 | 850 | ||
| 844 | // Process PR events from purgatory | 851 | // Process PR events from purgatory |
| 845 | let pr_result = | 852 | let pr_result = process_purgatory_pr_events( |
| 846 | process_purgatory_pr_events(&identifier, source_repo_path, database, local_relay, purgatory, git_data_path).await; | 853 | &identifier, |
| 854 | source_repo_path, | ||
| 855 | database, | ||
| 856 | local_relay, | ||
| 857 | purgatory, | ||
| 858 | git_data_path, | ||
| 859 | ) | ||
| 860 | .await; | ||
| 847 | result.merge(pr_result); | 861 | result.merge(pr_result); |
| 848 | 862 | ||
| 849 | if result.released_any() { | 863 | if result.released_any() { |
| @@ -1113,7 +1127,9 @@ async fn process_purgatory_pr_events( | |||
| 1113 | error = %e, | 1127 | error = %e, |
| 1114 | "Failed to fetch repository data for PR events" | 1128 | "Failed to fetch repository data for PR events" |
| 1115 | ); | 1129 | ); |
| 1116 | result.errors.push(format!("Failed to fetch repo data: {}", e)); | 1130 | result |
| 1131 | .errors | ||
| 1132 | .push(format!("Failed to fetch repo data: {}", e)); | ||
| 1117 | return result; | 1133 | return result; |
| 1118 | } | 1134 | } |
| 1119 | }; | 1135 | }; |
| @@ -1137,8 +1153,8 @@ async fn process_purgatory_pr_events( | |||
| 1137 | } | 1153 | } |
| 1138 | 1154 | ||
| 1139 | // Extract owner pubkey | 1155 | // Extract owner pubkey |
| 1140 | let owner_pubkey = extract_owner_from_repo_path(source_repo_path, git_data_path) | 1156 | let owner_pubkey = |
| 1141 | .unwrap_or_default(); | 1157 | extract_owner_from_repo_path(source_repo_path, git_data_path).unwrap_or_default(); |
| 1142 | 1158 | ||
| 1143 | // Use unified processing function | 1159 | // Use unified processing function |
| 1144 | let process_result = crate::git::process::process_pr_with_git_data( | 1160 | let process_result = crate::git::process::process_pr_with_git_data( |
| @@ -1192,7 +1208,9 @@ async fn process_purgatory_pr_events( | |||
| 1192 | error = %e, | 1208 | error = %e, |
| 1193 | "Failed to save PR event to database" | 1209 | "Failed to save PR event to database" |
| 1194 | ); | 1210 | ); |
| 1195 | result.errors.push(format!("Failed to save PR event: {}", e)); | 1211 | result |
| 1212 | .errors | ||
| 1213 | .push(format!("Failed to save PR event: {}", e)); | ||
| 1196 | } | 1214 | } |
| 1197 | } | 1215 | } |
| 1198 | } | 1216 | } |
| @@ -1527,11 +1545,7 @@ mod tests { | |||
| 1527 | } | 1545 | } |
| 1528 | 1546 | ||
| 1529 | // Helper function to create a test state event with specific timestamp | 1547 | // Helper function to create a test state event with specific timestamp |
| 1530 | fn create_test_state_event( | 1548 | fn create_test_state_event(keys: &Keys, identifier: &str, created_at: u64) -> RepositoryState { |
| 1531 | keys: &Keys, | ||
| 1532 | identifier: &str, | ||
| 1533 | created_at: u64, | ||
| 1534 | ) -> RepositoryState { | ||
| 1535 | create_test_state_event_with_nonce(keys, identifier, created_at, "") | 1549 | create_test_state_event_with_nonce(keys, identifier, created_at, "") |
| 1536 | } | 1550 | } |
| 1537 | 1551 | ||