Web3/Infura stops reacting to events after some time

I am listening to events a smart contract emits via

const CONTRACT= new web3.eth.Contract(

listener = CONTRACT.events.MyEvent();

liquidityLockListener.on("data", async (event) => {
  // do things

but i have noticed the listener stops listening to emitted events after some time. No error being emitted whatsoever, it just stops doing its thing.
any idea?
the events I am listening to are usually very slow, few hours between them. Is there a possibility that web3 maybe just silently times out or something? Again, I am not getting any error messages, it just doesnt do anything anymore.
I receive the first events after I start up the script perfectly fine but after some time it just stops

Hi @Trivo, and welcome to the Infura community!

Yes, there is typically a timeout over HTTP connections with web3. One option is to connect via WebSocket instead of HTTP, or you can usually override the timeout. For web3js, there are a few different options to override their timeouts listed here in their docs.