Attracted to my ex

I’ve seen my ex this Monday and I’ve been thinking about him since then. I invent scenarios in my head where we have an affair or where we have a relationship together. I compare it to my current life with my husband.

C Lunch with my ex
T He likes me
F Excited
A Invent scenarios, write to him in my head, talk to him in my head
R I invest mental time and energy to a fantasy that doesn’t exist

C Lunch with my ex
T This is a professional relationship
F Neutral
A Respond to his email, focus back on my present and on my husband when I catch myself daydreaming
R I take care of my mental health

It is nice to think that my ex likes me and that we have a lot in common. I guess I will be always attracted to him and that’s ok, but I don’t want to give too much air time in my head as this might not be very healthy. Might it be indulging because I don’t want to feel uncomfortable in my current relationship with my husband right now? Thank you for your help!