Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server): cancel namespace removal while stopping app #980

Merged
merged 1 commit into from
Mar 29, 2023

Conversation

maslow
Copy link
Member

@maslow maslow commented Mar 29, 2023

No description provided.

await this.relock(appid, waitingTime)
return
}

// update application phase to `Stopped`
await db.collection<Application>('Application').updateOne(
{ appid, phase: ApplicationPhase.Stopping },
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the code review.

  1. It's a good practice to add comments to explain the logic of the code. In this case, the comment "check if the service is removed" should be added to describe the purpose of the if condition.

  2. It is also recommended to use more descriptive variable names. For example, "instance.service" can be replaced with something like "instance.isServiceRemoved".

  3. It is better to break the long statement into multiple lines for better readability.

  4. Make sure the waitingTime parameter is valid before using it in the relock() method.

@maslow maslow merged commit 8213bea into labring:main Mar 29, 2023
@@ -280,9 +282,6 @@ export class InstanceService {
const name = appid
await coreV1Api.deleteNamespacedService(name, namespace.metadata.name)
}

// delete application namespace
await this.clusterService.removeAppNamespace(region, appid)
}

async get(app: Application) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the code review:

  1. On line 34, adding a comment helps explain the purpose of the new code. This is a good practice as it makes the code easier to understand and maintain.
  2. On line 280, the code for deleting the application namespace should be added back in order to properly clean up the environment.

@maslow maslow deleted the fix-rml-ns branch March 29, 2023 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant