cheange back to configure scope
@@ -319,13 +319,10 @@ async fn listen_github_webhooks(
let event_type = EventType::from_str(&event_type_string).unwrap();
// Add context to sentry.
- sentry::with_scope(
- |scope| {
+ sentry::configure_scope(|scope| {
scope.set_context("github.webhook", sentry::protocol::Context::Other(event.clone().into()));
scope.set_tag("github.event.type", &event_type_string);
- },
- || async {
- let mut ok_to_continue = true;
+ });
// Filter by event type any actions we can rule out for all repos.
match event_type {
@@ -335,7 +332,6 @@ async fn listen_github_webhooks(
// `push` event has no commits.
// We can throw this out, log it and return early.
sentry::capture_message("`push` event has no commits", sentry::Level::Fatal);
- ok_to_continue = false;
}
let commit = event.commits.get(0).unwrap().clone();
@@ -347,7 +343,6 @@ async fn listen_github_webhooks(
&format!("`push` event commit `{}` is not distinct", commit.id),
sentry::Level::Fatal,
);
- ok_to_continue = false;
}
// Get the branch name.
@@ -358,7 +353,6 @@ async fn listen_github_webhooks(
// We can throw this out, log it and return early.
// This should never happen, but we won't rule it out because computers.
sentry::capture_message("`push` event branch name is empty", sentry::Level::Fatal);
- ok_to_continue = false;
}
}
EventType::Repository => {
@@ -376,7 +370,7 @@ async fn listen_github_webhooks(
}
// Run the correct handler function based on the event type and repo.
- if !event.repository.name.is_empty() && ok_to_continue {
+ if !event.repository.name.is_empty() {
let repo = &event.repository;
let repo_name = Repo::from_str(&repo.name).unwrap();
@@ -465,8 +459,6 @@ async fn listen_github_webhooks(
}
}
}
- },
- ).await;
sentry::end_session();
Ok(HttpResponseAccepted("ok".to_string()))
