mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-29 09:15:33 +00:00
Some stuff
This commit is contained in:
@@ -81,12 +81,12 @@ public class APIController : Controller {
|
|||||||
[FeatureGate(Features.SyntaxCheck, Features.AdminService)]
|
[FeatureGate(Features.SyntaxCheck, Features.AdminService)]
|
||||||
public async Task<ActionResult<Dictionary<string, SyntaxCheckModel>?>> GetSyntaxCheck(string? id) {
|
public async Task<ActionResult<Dictionary<string, SyntaxCheckModel>?>> GetSyntaxCheck(string? id) {
|
||||||
var SCCache = _xmlService.GetSCCache();
|
var SCCache = _xmlService.GetSCCache();
|
||||||
if (_xmlProvider.HasChanged() || SCCache == null) {
|
if (SCCache == null) {
|
||||||
await _syntaxCheckLock.WaitAsync();
|
await _syntaxCheckLock.WaitAsync();
|
||||||
try {
|
try {
|
||||||
// Double-check after acquiring lock
|
// Double-check after acquiring lock
|
||||||
SCCache = _xmlService.GetSCCache();
|
SCCache = _xmlService.GetSCCache();
|
||||||
if (_xmlProvider.HasChanged() || SCCache == null) {
|
if (SCCache == null) {
|
||||||
var commit = _xmlProvider.GetGitState();
|
var commit = _xmlProvider.GetGitState();
|
||||||
SCCache = _xmlService.Test(_xmlService.GetState(), commit != null ? commit.Commit : string.Empty);
|
SCCache = _xmlService.Test(_xmlService.GetState(), commit != null ? commit.Commit : string.Empty);
|
||||||
_xmlService.SetSCCache(SCCache);
|
_xmlService.SetSCCache(SCCache);
|
||||||
|
|||||||
@@ -49,10 +49,8 @@ public class XMLFileProvider : IXMLFileProvider {
|
|||||||
_hamannFileProvider = new PhysicalFileProvider(hamannPath);
|
_hamannFileProvider = new PhysicalFileProvider(hamannPath);
|
||||||
_workingTreeFileProvider = new PhysicalFileProvider(gitPath);
|
_workingTreeFileProvider = new PhysicalFileProvider(gitPath);
|
||||||
|
|
||||||
// Pull latest changes on startup (if repo exists)
|
// Pull latest changes on startup
|
||||||
if (_GitService.GetGitState() != null) {
|
_GitService.Pull();
|
||||||
_GitService.Pull();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create File Lists; Here and in xmlservice, which does preliminary checking
|
// Create File Lists; Here and in xmlservice, which does preliminary checking
|
||||||
Scan();
|
Scan();
|
||||||
|
|||||||
Reference in New Issue
Block a user