Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
fix: MySQL deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
K4ryuu committed Apr 4, 2024
1 parent d6fda9c commit f88d86c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions K4-System/src/Plugin/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ public override void Load(bool hotReload)

GameRules = Utilities.FindAllEntitiesByDesignerName<CCSGameRulesProxy>("cs_gamerules").First().GameRules;
}

Task.Run(PurgeTableRows);
}

public override void Unload(bool hotReload)
Expand Down Expand Up @@ -198,6 +196,7 @@ await Database.Instance.ExecuteWithTransactionAsync(async (connection, transacti
}
});

await PurgeTableRows();
return true;
}
}
Expand Down
3 changes: 1 addition & 2 deletions K4-System/src/Plugin/PluginBasics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ public void Initialize_Events()

RegisterListener<Listeners.OnMapStart>((mapName) =>
{
Task.Run(PurgeTableRows);
AddTimer(1.0f, () =>
{
GameRules = Utilities.FindAllEntitiesByDesignerName<CCSGameRulesProxy>("cs_gamerules").First().GameRules;
Expand All @@ -177,6 +175,7 @@ public void Initialize_Events()
RegisterListener<Listeners.OnMapEnd>(() =>
{
GameRules = null;
Task.Run(PurgeTableRows).Wait();
});
}
}
Expand Down

0 comments on commit f88d86c

Please sign in to comment.