Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 7 additions & 17 deletions src/services/application-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,25 +313,15 @@ const _updateMicroservices = async function (application, microservices, isCLI,
for (const microservice of updatedMicroservices) {
await MicroserviceService.createMicroserviceEndPoint(microservice, isCLI, transaction)
}
iofogUuids
.filter(onlyUnique)
.filter((val) => val !== null)
for (const iofogUuid of iofogUuids) {
for (const iofogUuid of iofogUuids.filter(onlyUnique).filter((val) => val !== null)) {
await ChangeTrackingService.update(iofogUuid, ChangeTrackingService.events.microserviceFull, transaction)
}
oldMsvcsIofogUuids
.filter(onlyUnique)
.filter((val) => val !== null)
.forEach(async (iofogUuid) => {
await MicroserviceService.updateChangeTracking(true, iofogUuid, transaction)
})

updatedMsvcsUuid
.filter(onlyUnique)
.filter((val) => val !== null)
.forEach(async (iofogUuid) => {
await MicroserviceService.updateChangeTracking(true, iofogUuid, transaction)
})
for (const iofogUuid of oldMsvcsIofogUuids.filter(onlyUnique).filter((val) => val !== null)) {
await MicroserviceService.updateChangeTracking(true, iofogUuid, transaction)
}
for (const iofogUuid of updatedMsvcsUuid.filter(onlyUnique).filter((val) => val !== null)) {
await MicroserviceService.updateChangeTracking(true, iofogUuid, transaction)
}
}

const getUserApplicationsEndPoint = async function (isCLI, transaction) {
Expand Down
6 changes: 4 additions & 2 deletions src/services/microservices-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -1709,13 +1709,15 @@ async function deleteMicroserviceEndPoint (microserviceUuid, microserviceData, i

async function deleteNotRunningMicroservices (fog, transaction) {
const microservices = await MicroserviceManager.findAllWithStatuses({ iofogUuid: fog.uuid }, transaction)
microservices
const toDelete = microservices
.filter((microservice) => microservice.delete)
.filter((microservice) => microservice.microserviceStatus.status === MicroserviceStates.UNKNOWN ||
microservice.microserviceStatus.status === MicroserviceStates.STOPPING ||
microservice.microserviceStatus.status === MicroserviceStates.DELETING ||
microservice.microserviceStatus.status === MicroserviceStates.MARKED_FOR_DELETION)
.forEach(async (microservice) => { await deleteMicroserviceWithRoutesAndPortMappings(microservice, transaction) })
for (const microservice of toDelete) {
await deleteMicroserviceWithRoutesAndPortMappings(microservice, transaction)
}
}

async function createPortMappingEndPoint (microserviceUuid, portMappingData, isCLI, transaction) {
Expand Down