| 55 | |
| 56 | impl Store { |
| 57 | pub async fn activity( |
| 58 | &self, |
| 59 | repo_id: RepoId, |
| 60 | topic_id: &Option<ExternalId>, |
| 61 | first: i32, |
| 62 | ) -> Result<Vec<git::activity::Change>> { |
| 63 | let result = git::activity::FetchActivity { |
| 64 | actor: Arc::clone(&self.viewer), |
| 65 | path: topic_id.as_ref().map(|id| (repo_id, id.to_owned())), |
| 66 | first: first.try_into().unwrap_or(3), |
| 67 | } |
| 68 | .call(&self.git, &self.redis); |
| 69 | |
| 70 | match result { |
| 71 | Ok(git::activity::FetchActivityResult { changes, .. }) => Ok(changes), |
| 72 | Err(err) => { |
| 73 | log::error!("problem fetching activity: {}", err); |
| 74 | Ok(vec![]) |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | pub async fn delete_account(&self, user_id: String) -> Result<psql::DeleteAccountResult> { |
| 80 | log::info!("account deletion: fetching account info for {}", user_id); |