Paul Campbell
c9efbb9936
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.
23 lines
657 B
Rust
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,
|
|
);
|
|
}
|
|
}
|