I never recommend flushing, but it doesn't seem to be a "how long" question, it's about running a volume of water through the pot, like you want 50-100% of the volume of the pot to come out.
Flushing always seems to add a nutrient deficiency or an overwatering problem to whatever problem you're trying to fix. But see what happens for yourself.
You can mix epsom salts and cal/mag, but if you have a magnesium deficiency, try just the epsom salts. To much calcium can actually lockout magnesium.