Bad flies affect your grow experience, by disturbing your plants (eating leaves or laying eggs in the soil that'll disturb the roots). Good flies, they mind their own business without troubling your weed

So like others said, Fungus gnats and such.
Personally, I grow outdoor, I raised some mosquito net around my plants. I started noticing male mosquitoes and flies INSIDE the mosquito net. They actually had laid eggs in the soil before I raised the net, and now only were coming out (perhaps the previous summer/autumn eggs were deposited)
I freaked out a bit, tensed days/weeks, checking my plants everyday for signs of damage. Nothing

They all died off, of starvation. Eventually nothing came out of the ground anymore (As much as I don't like killing, I cannot take every fly off the mosquito net, everyday... Stupid insect doesnt want to leave the net when I open it, I can't help it more than that. Evolution, natural selection.)
So I advise to observe your plants carefully over the days, and you should know if you need to do something or not. Or you could do as planned, clean everything and bubye.