Bleeding for 31 days

I’ve had had my period for the last 31 days: some days are spotting, some days light bleeding, some days normal.

Before that, I didn’t have my period for 2 months. During that time, I wasn’t eating properly due a jaw problem, so I assumed my body stopped the period bc of that.

But why know I have been bleeding for so long?

I am 30yo and it’s first time this happens to me.