I am spraying all of my house drains with a spray detergent that contains bleach as well, almost once a month and let it sit overnight. I do that preemptively anyway.
When I did actually have fruit flies in the house, it seemed as though the kitchen was the problem (although I never leave food outside).
However I found out that most came from that little overflow hole in the bathroom sink.
So I sprayed the same detergent down there and let it sit overnight and they were gone!