working as intended

This commit is contained in:
Maximilian Wagner
2025-12-26 02:50:34 +01:00
parent 6fc4ee2716
commit 8dcf9fba11
5 changed files with 110 additions and 15 deletions

View File

@@ -77,16 +77,17 @@ func SSEventHandler(writer http.ResponseWriter, request *http.Request) {
writer.Header().Set("Content-Type", "text/event-stream")
writer.Header().Set("Cache-Control", "no-cache")
writer.Header().Set("Connection", "keep-alive")
ssePing(&writer)
lastExecution := "startup"
for range time.Tick(time.Second) {
if lastExecution == globals.LatexExec.Timestamp {
if lastExecution == globals.LatexExec.TimestampRFC {
ssePing(&writer)
} else {
sseStatusSend(&writer)
ssePDFSend(&writer)
sseOutputSend(&writer)
// comment out for testing purposes
lastExecution = globals.LatexExec.Timestamp
lastExecution = globals.LatexExec.TimestampRFC
}
}
}
@@ -114,6 +115,6 @@ func MainHandler(writer http.ResponseWriter, request *http.Request) {
}
func PDFCompile(writer http.ResponseWriter, request *http.Request) {
backend.LatexCompile(globals.AppConfig, &globals.LatexExec)
backend.LatexCompile()
}