Integrate SP auctions for app deployment #2

Merged
nabarun merged 42 commits from ng-integrate-auction into main 2024-10-18 12:37:01 +00:00
Showing only changes of commit ea268a4149 - Show all commits

View File

@ -319,21 +319,26 @@ export class Service {
if (completedAuctionIds) { if (completedAuctionIds) {
const projectsToBedeployed = projects.filter((project) => const projectsToBedeployed = projects.filter((project) =>
completedAuctionIds.includes(project.auctionId!) && project.deployerLrns !== null completedAuctionIds.includes(project.auctionId!)
); );
for (const project of projectsToBedeployed) { for (const project of projectsToBedeployed) {
log(`Auction ${project!.auctionId} completed`); log(`Auction ${project!.auctionId} completed`);
const deployerLrns = await this.laconicRegistry.getAuctionWinningDeployers(project!.auctionId!); const deployerLrns = await this.laconicRegistry.getAuctionWinningDeployers(project!.auctionId!);
// Update project with deployer LRNs
await this.db.updateProjectById(project.id!, {
deployerLrns
});
for (const deployer of deployerLrns) { if (!deployerLrns) {
log(`Creating deployment for deployer LRN ${deployer}`); log(`No winning deployer for auction ${project!.auctionId}`);
await this.createDeploymentFromAuction(project, deployer); } else {
// Update project with deployer LRNs
await this.db.updateProjectById(project.id!, {
deployerLrns
});
for (const deployer of deployerLrns) {
log(`Creating deployment for deployer LRN ${deployer}`);
await this.createDeploymentFromAuction(project, deployer);
}
} }
} }
} }