feat: archive forge data if it doesn't exist

This commit is contained in:
Aravinth Manivannan 2022-06-03 23:14:57 +05:30
parent 8d222d185b
commit 7e0c235275
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88

View file

@ -41,7 +41,15 @@ impl Ctx {
forge_type: gitea.forge_type(),
};
db.create_forge_isntance(&msg).await.unwrap();
federate.create_forge_isntance(&msg).await.unwrap();
} else {
if !federate.forge_exists(hostname).await.unwrap() {
let forge = db.get_forge(hostname).await.unwrap();
let msg = CreateForge {
hostname,
forge_type: forge.forge_type,
};
federate.create_forge_isntance(&msg).await.unwrap();
}
}
loop {