git-next/crates/repo-actor/src/handlers/receive_repo_config.rs
Paul Campbell c9efbb9936
All checks were successful
Rust / build (push) Successful in 1m26s
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
fix: ReceiveRepoConfig tries to send two messages
Similar to CloneRepo the handler tries to send two messages one after
the other. Leave it to WebhookRegistered handler to kick off the
ValidateRepo. Also update the README with the correct message sequence.
2024-06-30 16:59:24 +01:00

23 lines
657 B
Rust

//
use actix::prelude::*;
use crate as actor;
impl Handler<actor::messages::ReceiveRepoConfig> for actor::RepoActor {
type Result = ();
#[tracing::instrument(name = "RepoActor::ReceiveRepoConfig", skip_all, fields(repo = %self.repo_details, branches = ?msg))]
fn handle(
&mut self,
msg: actor::messages::ReceiveRepoConfig,
ctx: &mut Self::Context,
) -> Self::Result {
let repo_config = msg.unwrap();
self.repo_details.repo_config.replace(repo_config);
actor::do_send(
ctx.address(),
actor::messages::RegisterWebhook::new(),
&self.log,
);
}
}