feat(actors/repo): add RepoActor::new
All checks were successful
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/push/docker Pipeline was successful
ci/woodpecker/push/todo-check Pipeline was successful
ci/woodpecker/push/build Pipeline was successful

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;
pub struct RepoActor {
pub details: RepoDetails,
details: RepoDetails,
}
impl RepoActor {
pub(crate) const fn new(details: RepoDetails) -> Self {
Self { details }
}
}
impl Actor for RepoActor {
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 _guard = span.enter();
info!("Creating Repo");
let actor = actors::repo::RepoActor {
details: config::RepoDetails::new(&repo_name, repo, &forge_name, forge),
};
let actor = actors::repo::RepoActor::new(config::RepoDetails::new(
&repo_name,
repo,
&forge_name,
forge,
));
actors.push((forge_name.clone(), repo_name, actor));
info!("Created Repo");
});