How long does it take to get sth out of milk?

If I ate sth that causes gas, how long does it take for it to get out of my milk? By baby has been screaming for hours and it just hit me, I ate french beans yesterday but one. I didn't think of it when I did. I was hungry and I opened my freezer to find anything cooked because I hadn't had a meal all day.

Now my baby is screaming bloody murder. I asked my midwife what to do and she asked if I ate anything that causes gas. I pump besides breastfeeding and I think I gave the baby milk from milk I pumped when I ate the French beans.

How much of my milk should I throw out? Is the milk I pumped today also gonna cause him pain? Is the milk I pumped yesterday safe?