If you have a bird do not spray ANYTHING to kill the flies or risk killing the bird.
Try washing the fruit and veg and then process or put away somewhere else.
Door Screens?
Jam jar (on window sill outside) with jam and water in and with a lid on with holes punched for the flies to crawl in and drown but not big enough to climb out!
We get them in my kitchen sometimes. Put like an inch of Apple cider vinegar in the bottom of a shallow cup and then coat your finger in dish soap and swirl it through. They're attracted to the vinegar and the soap breaks the surface tension so they fall in and drown... I just re do it every few days until they're all gone...
I've made fruit fly traps placing either wine or balsamic vinegar inside a jar with a few drops of dishwashing liquid added. I put a top with either a piece of paper fashioned into a cone taped to the top without any escape spots. The fruit flies enter through the tiny hole that's the bottom of the funnel, but they can't escape and therefore drown. I've also taken a shallow dish with the liquids added, place a piece of saran wrap tightly over the top, poke some little holes into the saran, and set the traps close to the most heavily populated areas.
I went to the dollar store and got salt and pepper shakers. I put the vinegar and soap in the bottom and then placed them throughout the bird room and in the kitchen. I haven't had any for a long time now.
@Aquila, I just bought some Dr. Killigan's 'Killing them Softly' pantry moth killer. It's working great! It attracts the males only to the pheramone scented sticky paper. My little sticky huts are filled with them!