Skip to content

Commit

Permalink
temp workaround: make decisions filtering less broken
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal-Delange committed Nov 6, 2024
1 parent 8999c54 commit df101a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions api/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ const (
BATCH_INGESTION_TIMEOUT = 55 * time.Second

SEQUENTIAL_DECISION_TIMEOUT = 30 * time.Second
DEFAULT_TIMEOUT = 5 * time.Second

// TODO: temporary workaround, what we need to do is to make the endpoint reliably respond quickly even
// without warmup
LIST_DECISION_TIMEOUT = 10 * time.Second

DEFAULT_TIMEOUT = 5 * time.Second
)

func addRoutes(r *gin.Engine, auth Authentication, tokenHandler TokenHandler, uc usecases.Usecases, marbleAppHost string) {
Expand All @@ -47,7 +52,7 @@ func addRoutes(r *gin.Engine, auth Authentication, tokenHandler TokenHandler, uc

router.GET("/ast-expression/available-functions", tom, handleAvailableFunctions)

router.GET("/decisions", tom, handleListDecisions(uc, marbleAppHost))
router.GET("/decisions", timeoutMiddleware(LIST_DECISION_TIMEOUT), handleListDecisions(uc, marbleAppHost))
router.POST("/decisions", timeoutMiddleware(models.DECISION_TIMEOUT), handlePostDecision(uc, marbleAppHost))
router.POST("/decisions/all",
timeoutMiddleware(SEQUENTIAL_DECISION_TIMEOUT),
Expand Down
2 changes: 1 addition & 1 deletion models/pagination_and_sorting.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type (
)

const (
COUNT_ROWS_LIMIT = 9000
COUNT_ROWS_LIMIT = 1000
SortingOrderAsc SortingOrder = "ASC"
SortingOrderDesc SortingOrder = "DESC"
)
Expand Down

0 comments on commit df101a8

Please sign in to comment.