From 7d049d3cda599036fdc409f4512aa05c0d20fa34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Sat, 16 Jul 2022 13:24:59 +0200 Subject: [PATCH] Manager: make artificial API delay actually optional For development of the web interface, to get a less predictable order of asynchronous requests, the API responses were artificially delayed. This was supposed to be optional, to be enabled via the `-delay` CLI argument, but somehow the optionalness either never made it in or was mysteriously removed. --- cmd/flamenco-manager/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/flamenco-manager/main.go b/cmd/flamenco-manager/main.go index b2e65ef6..5ba16303 100644 --- a/cmd/flamenco-manager/main.go +++ b/cmd/flamenco-manager/main.go @@ -292,7 +292,9 @@ func buildWebService( e.Use(middleware.Recover()) // For development of the web interface, to get a less predictable order of asynchronous requests. - e.Use(randomDelayMiddleware) + if cliArgs.delayResponses { + e.Use(randomDelayMiddleware) + } // Disabled, as it causes issues with "204 No Content" responses. // TODO: investigate & file a bug report. Adding the check on an empty slice