Skip to content

Recompilation speedup: avoid dependency on Pleroma.User in EnsurePublicOrAuthenticatedPlug

Alex Gleason requested to merge cycles-ensure-plug into develop

#2651 (closed)

Alright guys, I saved the best for last. This one needs to break a cycle on EnsurePublicOrAuthenticatedPlug, a frequent compile dep, by getting rid of its dependency on Pleroma.User.

To do that I just made it check that assigns.user is a struct, and not %User{} specifically. This gets rid of the last cycle for the coveted "No cycles found" message.

There is an alternate way to solve this problem, by refactoring :skip_plug calls into functions of Pleroma.Web. You can see that here:

Let me know which way you prefer.

Edited by Alex Gleason

Merge request reports