-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix: fix issue with add node do not restart docker #8838
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -245,11 +245,11 @@ export namespace Setting { | |
| nodeID: number; | ||
| licenseID: number; | ||
| syncList: string; | ||
| withRestartDocker: boolean; | ||
| withDockerRestart: boolean; | ||
| } | ||
| export interface LicenseUnbind { | ||
| id: number; | ||
| force: boolean; | ||
| withRestartDocker: boolean; | ||
| withDockerRestart: boolean; | ||
| } | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that there is an error in the line Change: To: |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,12 +95,11 @@ const onBind = async (formEl: FormInstance | undefined) => { | |
|
|
||
| const submit = async () => { | ||
| loading.value = true; | ||
| console.log(withDockerRestart.value); | ||
| await bindLicense({ | ||
| licenseID: form.licenseID, | ||
| nodeID: form.nodeID, | ||
| syncList: form.syncList, | ||
| withRestartDocker: withDockerRestart.value, | ||
| withDockerRestart: withDockerRestart.value, | ||
| }) | ||
| .then(() => { | ||
| loading.value = false; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Your code appears to be mostly correct, but there is one minor issue: you have an extra line of Here's a revised version of the const submit = async () => {
loading.value = true;
try {
await bindLicense({
licenseID: form.licenseID,
nodeID: form.nodeID,
syncList: form.syncList,
withDockerRestart: withDockerRestart.value,
});
loading.value = false;
} catch (error) {
// Handle error here
}
};Summary of Changes:
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided code differences have been reviewed, and no significant irregularities or potential issues were found. There are, however, a couple of optimizations that can be suggested:
Logging Initialization: Ensure that
global.LOGis properly initialized before it's used to log information about restarting Docker. This helps prevent runtime errors if logging hasn't been configured correctly.Function Signature Changes: The function signature
getDockerRestartCommand()was modified to include an optional parameterwithErrorHandling. However, this change might lead to confusion without clear documentation on what this parameter accomplishes. It would be beneficial to document or explain its purpose.Variable Naming: The variable
req, which represents request data, should be named more descriptively, such assettingsRequest.These changes improve clarity and maintainability in the codebase.