I don't think a little foam is necessarily a bad thing. It is a sign of bacteria bloom but if you have the right culture going this can be beneficial.
Good bacteria do require cooler temperatures and plenty of O2 though, so if either of those conditions were NOT met then I agree with the flush and clean.
I use fish emulsion and molasses in a jug with a bubbler as nutes for my hempy veggies. My plants like it best when I wait until the solution in my jug foams before feeding it to 'em.