File tree Expand file tree Collapse file tree
src/matches/match-assistant Expand file tree Collapse file tree Original file line number Diff line number Diff 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 , {
You can’t perform that action at this time.
0 commit comments