async fn handle_repository_event(api_context: &Context, event: GitHubWebhook) -> Result<HttpResponseAccepted<String>, HttpError> {
    let repo = &api_context.github.repo(event.repository.owner.login, event.repository.name).get().await.unwrap();
    let nr = NewRepo::new(repo.clone());
    nr.upsert(&api_context.db).await;

    // TODO: since we know only one repo changed we don't need to refresh them all,
    // make this a bit better.
    // Update the short urls for all the repos.
    generate_shorturls_for_repos(&api_context.db, &api_context.github.repo(&api_context.github_org, "configs")).await;
    println!("generated shorturls for all the GitHub repos");

    Ok(HttpResponseAccepted("ok".to_string()))
}
/// Handle the `repository` event for all repos.
Handle the `repository` event for all repos.
Handle the ` repository ` event for all repos .
async fn handle_repository_event(api_context: &Context, event: GitHubWebhook) -> Result<HttpResponseAccepted<String>, HttpError> {
    let repo = &api_context.github.repo(event.repository.owner.login, event.repository.name).get().await.unwrap();
    let nr = NewRepo::new(repo.clone());
    nr.upsert(&api_context.db).await;
    // TODO: since we know only one repo changed we don't need to refresh them all,
    // make this a bit better.
    // Update the short urls for all the repos.
    generate_shorturls_for_repos(&api_context.db, &api_context.github.repo(&api_context.github_org, "configs")).await;
    println!("generated shorturls for all the GitHub repos");
    Ok(HttpResponseAccepted("ok".to_string()))
}
async fn handle_repository_event ( api_context : & Context , event : GitHubWebhook ) -> Result < HttpResponseAccepted < String > , HttpError > { let repo = & api_context . github . repo ( event . repository . owner . login , event . repository . name ) . get ( ) . await . unwrap ( ) ; let nr = NewRepo :: new ( repo . clone ( ) ) ; nr . upsert ( & api_context . db ) . await ; // TODO: since we know only one repo changed we don't need to refresh them all, // make this a bit better. // Update the short urls for all the repos. generate_shorturls_for_repos ( & api_context . db , & api_context . github . repo ( & api_context . github_org , " " ) ) . await ; println ! ( " " ) ; Ok ( HttpResponseAccepted ( " " . to_string ( ) ) ) }
Handle the `repository` event for all repos.
Handle the ` repository ` event for all repos .
api_context
&Context
event
GitHubWebhook
api_context
&Context
event
GitHubWebhook