git-next/crates/repo-actor/src/handlers/receive_repo_config.rs

24 lines
657 B
Rust
Raw Normal View History

//
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,
);
}
}