Also, don't use the provided Middleware, which isn't thread-safe, and
instantiate a new Flipper instance per thread instead.
Signed-off-by: Rémy Coutable <remy@rymai.me>
Flipper already takes care of flushing cache entries when
enabling/disabling features so it should be safe to increase the TTL.
This in turn should drastically reduce the number of Flipper queries
executed.
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/40854
This is a follow-up for !12362 where this was documented but the code
was removed in the last iteration. Since this can still be useful and
this is already supported by the API, I think re-adding the code was
the best course of action.
Signed-off-by: Rémy Coutable <remy@rymai.me>