working as intended
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user