Compare commits
7 commits
1135d48c97
...
0796af1485
Author | SHA1 | Date | |
---|---|---|---|
0796af1485 | |||
2851059fd6 | |||
bc338d7703 | |||
a9b35bdac5 | |||
74cf9a5d53 | |||
ac1baf8db0 | |||
28c8f6ebdf |
2 changed files with 26 additions and 13 deletions
|
@ -716,7 +716,7 @@ pub mod given {
|
|||
pub fn a_git_dir(fs: &kxio::fs::FileSystem) -> GitDir {
|
||||
let dir_name = a_name();
|
||||
let dir = fs.base().join(dir_name);
|
||||
GitDir::new(dir)
|
||||
GitDir::new(&dir)
|
||||
}
|
||||
|
||||
pub fn a_forge_config() -> ForgeConfig {
|
||||
|
@ -730,9 +730,9 @@ pub mod given {
|
|||
}
|
||||
|
||||
pub fn a_server_repo_config() -> ServerRepoConfig {
|
||||
let main = a_branch_name().to_string();
|
||||
let next = a_branch_name().to_string();
|
||||
let dev = a_branch_name().to_string();
|
||||
let main = a_branch_name().into_string();
|
||||
let next = a_branch_name().into_string();
|
||||
let dev = a_branch_name().into_string();
|
||||
ServerRepoConfig::new(
|
||||
format!("{}/{}", a_name(), a_name()),
|
||||
main.clone(),
|
||||
|
|
|
@ -101,13 +101,19 @@ impl Handler<ServerConfig> for Server {
|
|||
|
||||
// Forge Actors
|
||||
for (forge_alias, forge_config) in server_config.forges() {
|
||||
self.create_forge_repos(forge_config, forge_alias.clone(), server_storage, webhook)
|
||||
.into_iter()
|
||||
.map(|a| self.start_actor(a))
|
||||
.map(|(repo_alias, addr)| {
|
||||
AddWebhookRecipient::new(forge_alias.clone(), repo_alias, addr.recipient())
|
||||
})
|
||||
.for_each(|msg| webhook_router.do_send(msg));
|
||||
self.create_forge_repos(
|
||||
forge_config,
|
||||
forge_alias.clone(),
|
||||
server_storage,
|
||||
webhook,
|
||||
self.sleep_duration,
|
||||
)
|
||||
.into_iter()
|
||||
.map(|a| self.start_actor(a))
|
||||
.map(|(repo_alias, addr)| {
|
||||
AddWebhookRecipient::new(forge_alias.clone(), repo_alias, addr.recipient())
|
||||
})
|
||||
.for_each(|msg| webhook_router.do_send(msg));
|
||||
}
|
||||
|
||||
let webhook = WebhookActor::new(socket_addr, webhook_router.recipient()).start();
|
||||
|
@ -158,6 +164,7 @@ impl Server {
|
|||
forge_name: ForgeAlias,
|
||||
server_storage: &ServerStorage,
|
||||
webhook: &Webhook,
|
||||
sleep_duration: std::time::Duration,
|
||||
) -> Vec<(ForgeAlias, RepoAlias, repo_actor::RepoActor)> {
|
||||
let span =
|
||||
tracing::info_span!("create_forge_repos", name = %forge_name, config = %forge_config);
|
||||
|
@ -165,7 +172,13 @@ impl Server {
|
|||
let _guard = span.enter();
|
||||
info!("Creating Forge");
|
||||
let mut repos = vec![];
|
||||
let creator = self.create_actor(forge_name, forge_config.clone(), server_storage, webhook);
|
||||
let creator = self.create_actor(
|
||||
forge_name,
|
||||
forge_config.clone(),
|
||||
server_storage,
|
||||
webhook,
|
||||
sleep_duration,
|
||||
);
|
||||
for (repo_alias, server_repo_config) in forge_config.repos() {
|
||||
let forge_repo = creator((repo_alias, server_repo_config));
|
||||
info!(
|
||||
|
@ -183,6 +196,7 @@ impl Server {
|
|||
forge_config: ForgeConfig,
|
||||
server_storage: &ServerStorage,
|
||||
webhook: &Webhook,
|
||||
sleep_duration: std::time::Duration,
|
||||
) -> impl Fn((RepoAlias, &ServerRepoConfig)) -> (ForgeAlias, RepoAlias, repo_actor::RepoActor)
|
||||
{
|
||||
let server_storage = server_storage.clone();
|
||||
|
@ -190,7 +204,6 @@ impl Server {
|
|||
let net = self.net.clone();
|
||||
let repo = self.repo.clone();
|
||||
let generation = self.generation;
|
||||
let sleep_duration = self.sleep_duration;
|
||||
move |(repo_alias, server_repo_config)| {
|
||||
let span = tracing::info_span!("create_actor", alias = %repo_alias, config = %server_repo_config);
|
||||
let _guard = span.enter();
|
||||
|
|
Loading…
Reference in a new issue