Skip to content

Commit

Permalink
fix: Advanced Windows features bug (#222)
Browse files Browse the repository at this point in the history
Co-authored-by: Pedro Faria <[email protected]>
  • Loading branch information
pedrofaria and pedrofaria authored Jul 7, 2022
1 parent 3eb1791 commit 19a425d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \

RUN go install golang.org/x/tools/gopls@latest \
&& go install github.com/go-delve/delve/cmd/dlv@latest \
&& go install honnef.co/go/tools/cmd/staticcheck@latest
&& go install honnef.co/go/tools/cmd/staticcheck@latest \
&& curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.46.2

RUN mkdir -p /app && cd /app && git clone https://github.com/assetto-corsa-web/fake-accserver.git

Expand Down
8 changes: 4 additions & 4 deletions public/src/components/server.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default {
this.$emit("started");
})
.catch(e => {
this.$store.commit("toast", this.$t("start_server_error"))
this.$store.commit("toast", this.$t("start_server_error", {error: e.response.data.error}))
});
},
stop() {
Expand All @@ -107,7 +107,7 @@ export default {
this.$emit("stopped");
})
.catch(e => {
this.$store.commit("toast", this.$t("stop_server_error"))
this.$store.commit("toast", this.$t("stop_server_error", {error: e.response.data.error}))
});
}
}
Expand All @@ -127,8 +127,8 @@ export default {
"delete_server": "Delete server",
"copy_server_error": "Error copying server configuration.",
"delete_server_error": "Error deleting server configuration.",
"start_server_error": "Error starting server, please check the logs.",
"stop_server_error": "Error stopping server.",
"start_server_error": "Error starting server, please check the logs. ERROR: {error}",
"stop_server_error": "Error stopping server. ERROR: {error}",
"track": "Track",
"configuration_directory": "Config dir",
"running": "Running",
Expand Down
22 changes: 11 additions & 11 deletions public/src/components/server_config/accweb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,10 @@ export default {
}
};
},
mounted() {
axios.get("/api/metadata")
.then(r => {
this.os = r.data;
for (let i = 0; i <= this.os.numCpu; i++) {
this.coreAffinityCPU[i] = this.hasCPUAffinity(i)
}
})
},
methods: {
hasCPUAffinity(n) {
if (this.advWindowsCfg.coreAffinity == 0) {
if (this.advWindowsCfg.coreAffinity === 0) {
console.log("CPU Affinity was ZERO!");
this.advWindowsCfg.coreAffinity = Math.pow(2, this.os.numCpu) - 1;
}
Expand All @@ -109,6 +100,15 @@ export default {
if (data.advWindowsCfg !== null) {
this.advWindowsCfg = data.advWindowsCfg;
}
axios.get("/api/metadata")
.then(r => {
this.os = r.data;
for (let i = 0; i <= this.os.numCpu; i++) {
this.coreAffinityCPU[i] = this.hasCPUAffinity(i)
}
});
},
getData() {
if (this.enableAdvWindowsCfg) {
Expand Down

0 comments on commit 19a425d

Please sign in to comment.