Skip to content

Commit

Permalink
fix: mm fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterPtato committed Apr 22, 2024
1 parent a1a835d commit 6a35cea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions svc/pkg/mm/worker/redis-scripts/nomad_node_closed_set.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ for i=1,lobby_count do
local max_players_normal = tonumber(ARGV[real_i * 3 + 3])
local max_players_party = tonumber(ARGV[real_i * 3 + 4])

local key_lobby_config = KEYS[real_i * 4 + 2]
local key_lobby_config = KEYS[real_i * 4 + 1]

local is_closed = redis.call('HGET', key_lobby_config, 'c')

-- Don't modify closed lobbies
if is_closed ~= '1' then
local key_lobby_player_ids = KEYS[real_i * 4 + 3]
local key_lobby_available_spots_normal = KEYS[real_i * 4 + 4]
local key_lobby_available_spots_party = KEYS[real_i * 4 + 5]
local key_lobby_player_ids = KEYS[real_i * 4 + 2]
local key_lobby_available_spots_normal = KEYS[real_i * 4 + 3]
local key_lobby_available_spots_party = KEYS[real_i * 4 + 4]

local player_count = redis.call('ZCARD', key_lobby_player_ids)
redis.call('ZADD', key_lobby_available_spots_normal, max_players_normal - player_count, lobby_id)
Expand Down
4 changes: 2 additions & 2 deletions svc/pkg/mm/worker/src/workers/lobby_create/nomad_job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,8 @@ pub fn gen_lobby_docker_job(
x
}),
resources: Some(Box::new(resources.clone())),
// Gives the game processes time to shut down gracefully.
kill_timeout: Some(60 * 1_000_000_000),
// Intentionally high timeout. Killing jobs is handled manually with signals.
kill_timeout: Some(86400 * 1_000_000_000),
kill_signal: Some("SIGTERM".into()),
log_config: Some(Box::new(LogConfig {
max_files: Some(4),
Expand Down

0 comments on commit 6a35cea

Please sign in to comment.