git-next/crates/repo-actor/src/handlers/receive_repo_config.rs
Paul Campbell ffab1986a7
Some checks failed
ci/woodpecker/cron/cron-docker-builder Pipeline was successful
ci/woodpecker/cron/push-next Pipeline was successful
ci/woodpecker/cron/tag-created Pipeline was successful
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
Rust / build (push) Has been cancelled
ci/woodpecker/push/tag-created Pipeline was successful
refactor: repo-actor: rewrite tests using mockall
2024-06-27 18:58:47 +01:00

29 lines
811 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::ValidateRepo::new(self.message_token),
&self.log,
);
actor::do_send(
ctx.address(),
actor::messages::RegisterWebhook::new(),
&self.log,
);
}
}