implemented rate limiting

This commit is contained in:
Maximilian Wagner
2025-12-28 00:31:39 +01:00
parent 2c05415ed1
commit 03c0e3ca77
5 changed files with 74 additions and 41 deletions

View File

@@ -18,6 +18,7 @@ type Config struct {
LatexEngine string `json:"latexEngine"`
LatexSourceFilePath string `json:"latexSourceFilePath"`
LatexOutputPath string `json:"latexOutputPath"`
RateLimitSeconds int `json:"rateLimitSeconds"`
// webserver
WebserverDomain string `json:"webserverDomain"`
@@ -40,6 +41,8 @@ type LatexExecution struct {
var LatexExec LatexExecution
var LatexExecutionStateSuccess = "Success"
var LatexExecutionStateFailure = "Failure"
var LatexExecutionStateRunning = "Running"
var LatexExecutionStateLimit = "Running (rate limited)"
// Creates a copy of a LatexExecution (without the Mutex)
func (execution *LatexExecution) Copy() (exeCopy *LatexExecution) {