I do like Cali’s suggestion of using Neem cake mixed in the soil. That would prevent fungus flies from ever producing larvae in the first place. Also diatomaceous earth are like microscopic razors that shred the larvae skin, killing them, yet harmless to us.