Some stuff

This commit is contained in:
Simon Martens
2025-09-30 21:36:10 +02:00
parent d49b5fe246
commit 9ba2a10cb8
2 changed files with 4 additions and 6 deletions

View File

@@ -81,12 +81,12 @@ public class APIController : Controller {
[FeatureGate(Features.SyntaxCheck, Features.AdminService)]
public async Task<ActionResult<Dictionary<string, SyntaxCheckModel>?>> GetSyntaxCheck(string? id) {
var SCCache = _xmlService.GetSCCache();
if (_xmlProvider.HasChanged() || SCCache == null) {
if (SCCache == null) {
await _syntaxCheckLock.WaitAsync();
try {
// Double-check after acquiring lock
SCCache = _xmlService.GetSCCache();
if (_xmlProvider.HasChanged() || SCCache == null) {
if (SCCache == null) {
var commit = _xmlProvider.GetGitState();
SCCache = _xmlService.Test(_xmlService.GetState(), commit != null ? commit.Commit : string.Empty);
_xmlService.SetSCCache(SCCache);