Fruit flies are pests, but they can be dealt with.
In addition to the large number of homemade remedies, there are inexpensive, commercial ones, too.
One notable product is the Terro Fruit Fly Trap. Shaped like an apple, the Terro trap sits in your kitchen. It’s filled with a vinegar-like solution meant to attract and trap nearby fruit flies. Once the flies are contained, they can no longer breed, and the pest problem subsides.