forked from kemitix/git-next
feat(server): Don't load config from repo if repo config is in server config
Closes kemitix/git-next#77
This commit is contained in:
parent
6d147efe32
commit
ec2ebe70cf
1 changed files with 21 additions and 12 deletions
|
@ -100,7 +100,15 @@ impl Handler<CloneRepo> for RepoActor {
|
|||
info!("Message Received");
|
||||
let gitdir = self.details.gitdir.clone();
|
||||
match self.forge.repo_clone(gitdir) {
|
||||
Ok(_) => ctx.address().do_send(LoadConfigFromRepo),
|
||||
Ok(_) => {
|
||||
if self.details.repo_config.is_none() {
|
||||
ctx.address().do_send(LoadConfigFromRepo);
|
||||
} else {
|
||||
ctx.address().do_send(ValidateRepo {
|
||||
message_token: self.message_token,
|
||||
});
|
||||
}
|
||||
}
|
||||
Err(err) => warn!("Could not Clone repo: {err}"),
|
||||
}
|
||||
}
|
||||
|
@ -134,17 +142,7 @@ impl Handler<LoadedConfig> for RepoActor {
|
|||
info!("Message Received");
|
||||
let repo_config = msg.0;
|
||||
self.details.repo_config.replace(repo_config);
|
||||
if self.webhook_id.is_none() {
|
||||
webhook::register(
|
||||
self.details.clone(),
|
||||
self.webhook.clone(),
|
||||
ctx.address(),
|
||||
self.net.clone(),
|
||||
)
|
||||
.in_current_span()
|
||||
.into_actor(self)
|
||||
.wait(ctx);
|
||||
}
|
||||
|
||||
ctx.address().do_send(ValidateRepo {
|
||||
message_token: self.message_token,
|
||||
});
|
||||
|
@ -179,6 +177,17 @@ impl Handler<ValidateRepo> for RepoActor {
|
|||
}
|
||||
}
|
||||
info!("Message Received");
|
||||
if self.webhook_id.is_none() {
|
||||
webhook::register(
|
||||
self.details.clone(),
|
||||
self.webhook.clone(),
|
||||
ctx.address(),
|
||||
self.net.clone(),
|
||||
)
|
||||
.in_current_span()
|
||||
.into_actor(self)
|
||||
.wait(ctx);
|
||||
}
|
||||
if let Some(repo_config) = self.details.repo_config.clone() {
|
||||
let forge = self.forge.clone();
|
||||
let addr = ctx.address();
|
||||
|
|
Loading…
Reference in a new issue