Hernia repair

So I went to the doctor about my hernia and he said I have 2 options; 1) if the hernia gets removed i shouldn’t get pregnant till after 2 years or 2) wait until I finish birthing then they will repair it. Btw it’s umbilical hernia! Does it have anything to do with my pregnancy? I wasn’t expecting such options