feat(actors/repo): add RepoActor::new

This commit is contained in:
Paul Campbell 2024-04-08 09:55:40 +01:00
parent c3f2266dc1
commit abbd2e66e6
2 changed files with 12 additions and 4 deletions

View file

@ -4,7 +4,12 @@ use tracing::info;
use crate::server::config::RepoDetails; use crate::server::config::RepoDetails;
pub struct RepoActor { pub struct RepoActor {
pub details: RepoDetails, details: RepoDetails,
}
impl RepoActor {
pub(crate) const fn new(details: RepoDetails) -> Self {
Self { details }
}
} }
impl Actor for RepoActor { impl Actor for RepoActor {
type Context = Context<Self>; type Context = Context<Self>;

View file

@ -57,9 +57,12 @@ pub fn start(fs: FileSystem) {
let span = tracing::info_span!("Repo", %repo_name, %repo); let span = tracing::info_span!("Repo", %repo_name, %repo);
let _guard = span.enter(); let _guard = span.enter();
info!("Creating Repo"); info!("Creating Repo");
let actor = actors::repo::RepoActor { let actor = actors::repo::RepoActor::new(config::RepoDetails::new(
details: config::RepoDetails::new(&repo_name, repo, &forge_name, forge), &repo_name,
}; repo,
&forge_name,
forge,
));
actors.push((forge_name.clone(), repo_name, actor)); actors.push((forge_name.clone(), repo_name, actor));
info!("Created Repo"); info!("Created Repo");
}); });