Skip to content

Commit bca771f

Browse files
authored
Merge pull request #13 from 5stackgg/main
2 parents 5e4a3f9 + 669c01e commit bca771f

1 file changed

Lines changed: 27 additions & 4 deletions

File tree

src/matches/match-assistant/match-assistant.service.ts

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,16 +460,39 @@ export class MatchAssistantService {
460460

461461
let cpus: string;
462462
if (server.game_server_node?.supports_cpu_pinning) {
463-
const { settings_by_pk: cpuPinning } = await this.hasura.query({
464-
settings_by_pk: {
463+
const { settings } = await this.hasura.query({
464+
settings: {
465465
__args: {
466-
name: "number_of_cpus_per_server",
466+
where: {
467+
_or: [
468+
{
469+
name: {
470+
_eq: "enable_cpu_pinning",
471+
},
472+
},
473+
{
474+
name: {
475+
_eq: "number_of_cpus_per_server",
476+
},
477+
},
478+
],
479+
},
467480
},
481+
name: true,
468482
value: true,
469483
},
470484
});
471485

472-
cpus = cpuPinning?.value || "2";
486+
const cpuPinning = settings.find(
487+
(setting) => setting.name === "enable_cpu_pinning",
488+
);
489+
490+
if (cpuPinning?.value === "true") {
491+
const numberOfCpus = settings.find(
492+
(setting) => setting.name === "number_of_cpus_per_server",
493+
);
494+
cpus = numberOfCpus?.value || "2";
495+
}
473496
}
474497

475498
await batch.createNamespacedJob(this.namespace, {

0 commit comments

Comments
 (0)